Java – How to get list of declared exchanges and queues in rabbitmq using Java

javarabbitmq

I am looking for a way to list all declared exchanges, queues in rabbitmq using Java code.
I do know that command "rabbitmqctl list_queues" also I am aware of "rabbitmqadmin list queues"

Best Answer

You can use the HTTP API.

Install the web-management plug-in:

rabbitmq-plugins enable rabbitmq_management

then use the API to get the informations:

http://localhost:15672/api/exchanges
http://localhost:15672/api/queues

The full API list is available on:

http://localhost:15672/api/

Just execute an java http request and get the json result.