[rabbitmq-discuss] rabbitmqctl list_queues explanation needed

Simon MacMullen simon at rabbitmq.com
Wed Mar 9 10:51:08 GMT 2011


On 09/03/11 10:00, Matthias Radestock wrote:
> Matthew Sackman wrote:
>> On Tue, Mar 08, 2011 at 07:11:28PM +0530, Sunil Arora wrote:
>>> Is there a simple way to purge those messages without consuming them.
>>
>> Yes. The queue.purge AMQP method will purge the queue of unconsumed
>> messages.
>
> The management plug-in allows you to do that as well.

If you have a large number of queues you need to purge (which I think 
from your post you might have), you might find it useful to use the 
command line tool for the management plugin - rabbitmqadmin - in a loop 
like so:

$ rabbitmqadmin -f tsv -q list queues name | grep some_pattern | while 
read queue ; do rabbitmqadmin purge queue name=${queue} ; done

where some_pattern matches the queues you wish to purge.

Cheers, Simon
-- 
Simon MacMullen
Staff Engineer, RabbitMQ
SpringSource, a division of VMware



More information about the rabbitmq-discuss mailing list