Is there an API for listing queues and exchanges on RabbitMQ?

I looked quite a bit, but I could not find a good programmatic way to list the queues on the RabbitMQ server.

This is important because I need to clear my lines and exchanges when I am done with them. I don’t always have a good “ready-made” event that can be used to trigger a cleanup, so I would like to do this with most of the garbage collection model. If I can list the queues, I can verify that the objects with which they are associated should not create more records and clear them.

I know that I can use rabbitmqctlfor this, but this requires elevated privileges.

Since I could not find a way to list the queues programmatically, I saved the list of names in the database. It works, but it is ugly.

+2
source share
3 answers

You can use Alice - http://github.com/auser/alice . This is the REST interface for executing rabbitmqctl commands

+4
source

Update 2012

The development of RabbitMQ probably made the question and other answers obsolete. The management plugin that provides the REST API is now part of RabbitMQ. Perhaps the plugin may be disabled by default.

+2
source

, , , exchange_declare queue_declare.

Returning to your question about queues and exchanges, you can use a tool like this: http://github.com/tnc/rac

With a little tweaking, you can write a PHP script to get what you need. Just check under the lib folder of this project.

0
source

All Articles