RabbitMQ - List Exchanges using the rabbitmqctl command

by
Jeremy Canfield |
Updated: February 17 2022
| RabbitMQ articles
The rabbitmqctl command with the list_exchanges option can be used to list every exchange in a virtual host. If you do not specify a virtual host, the default / (forward slash) virtual host will be used.
~]# rabbitmqctl list_exchanges
Listing exchanges for vhost / ...
name type
exchange001 direct
exchange002 topic
Or, the -p or --vhost option can be used to specify the virtual host.
~]# rabbitmqctl list_exchanges --vhost foo
Listing exchanges for vhost foo ,,,
name type
a.exchange direct
b.exchange headers
The --formatter json option can be used to return the output in JSON.
rabbitmqctl list_exchanges --formatter json
Did you find this article helpful?
If so, consider buying me a coffee over at