Why can't you look at messages in the Rabbit Queue

If my understanding is correct, you can't actually look at messages in the rabbit queue without taking them out and putting them back in. There's no way to use rabbitmqctl to inspect a queue.

In some debugging contexts, knowing what is currently in the queue is very useful. Is there a way to get at the messages? Also, what is it about the design of Rabbit that makes this process cumbersome?


There is a "Get Messages" section for each queue in the management API. However this causes the message to be consumed and hence is a destructive action. We can re-queue this message to the queue only at the expense of sacrificing the ordering of messages [for rabbitmq versions < 2.7.0].

A more viable alternative would be to use the firehose tracer, http://www.rabbitmq.com/firehose.html [for rabbitmq versions> 2.5]. This essentially publishes the message to a different exchange (amq.rabbitmq.trace) just for debugging purposes.

Here is another GUI written on top of firehose for better visibility, http://www.rabbitmq.com/blog/2011/09/09/rabbitmq-tracing-a-ui-for-the-firehose/


You can certainly look at the contents of a queue in RabbitMQ, or any AMQP broker, for that matter. Just consume messages but don't acknowledge them. Once you close the channel the messages will be available for consumption by your 'real' consumers. Keep in mind that doing so might affect the ordering of messages in the queue which you inspect.

Also, the web management plugin offered by RabbitMQ allows you to view the contents of messages from the web interface. If you're trying to debug your system, it's a very helpful tool.


I have not used this personally yet but I saw RabbitMQ's management plugin that I thought allowed you to monitor the queue.

http://www.rabbitmq.com/management.html