[rabbitmq-discuss] flushing a queue?

Matthias Radestock matthias at lshift.net
Tue May 19 06:53:04 BST 2009


Alex,

Alex Polvi wrote:
> Is it possible to flush/remove the contents of a particular queue?

This can be done with the AMQP queue.purge command.

> Also, is it possible to see the contents of a particular queue? Would
> be great for debugging purposes, even if I need to use hexdump ...

One option is to consume messages from the queue using, say, basic,get, 
but not acknowledging them, and close the connection/channel when the 
last message has been read that way - which causes all the messages to 
be re-queued.

The main downside is that this isn't totally transparent to other 
consumers, e.g. the message order may change.

Or you could use the Erlang shell to poke inside the queue processes. 
That requires some knowledge of Erlang and the RabbitMQ internals.


Regards,

Matthias.




More information about the rabbitmq-discuss mailing list