how can I cleanup (delete messages) in a rabbitmq queue?
I'm using Ubuntu 14.04 and rabbitmq-server 3.2.4-1
Example:
# rabbitmqctl list_queues -p openstack
Listing queues ...
...
notifications.info 372
...
how can I cleanup (delete messages) in a rabbitmq queue?
I'm using Ubuntu 14.04 and rabbitmq-server 3.2.4-1
# rabbitmqctl list_queues -p openstack
Listing queues ...
...
notifications.info 372
...
For example:
sudo apt-get install amqp-tools
amqp-delete-queue -q name_from_queue
In this link you have more options: https://stackoverflow.com/questions/5313027/rabbitmq-how-do-i-delete-all-messages-from-a-single-queue
is there a way to cleanup the queue without deleting the queue?
Yes; this is called purging the queue and there are plenty of ways to do it.
This is because in addition to being something that one can do with tools like rabbitmqadmin pointed at the broker it's an operation accessible directly from the protocol. So people can write, and have written, tools that take queue names and enact the queue.purge method against them, in languages as varied as C++ and Python.
The Ubuntu amqp-utils package is a little light on such tools, but one doesn't have to look far to find things like Doug Barth's amqp-utils toolset written in Ruby and containing an amqp-purge utility.
The rabbitmqadmin syntax is:
rabbitmqadmin purge queue queue-name
queue.purge. AMQP 0-9-1 Quick Reference. Pivotal Software. 2015.rabbitmqadmin. Pivotal Software. 2015.If this is a common operational action for Rabbit, then we should add an action to the juju charm so that it is easily invoked remotely without having to log on to the system. Juju would also take care to ensure that this was done at a time when nothing else was happening on the system (from an ops / deployment perspective obviously).