Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

rabbitmq

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?

like image 693
archgoon Avatar asked Mar 26 '12 14:03

archgoon


People also ask

How do I get all messages from RabbitMQ?

exports = (connection, queue) => { init(connection, queue); return { getMessages: (queueName, cleanQueue) => new Promise((resolve) => { let messages = []; let i = 1; getChannel(). then((ch) => { ch. consume(queueName, (msg) => { messages. push(msg); console.

Is RabbitMQ message in queue?

RabbitMQ is a message-queueing software also known as a message broker or queue manager. Simply said; it is software where queues are defined, to which applications connect in order to transfer a message or messages. A message can include any kind of information.

Why RabbitMQ shows activity on message rates but not on queued messages?

convertAndSend was not set properly -- the message was not sent to the correct queue -- the Queued messages was empty all time. however, Message rates is not zero, it does show there are message get sent. Which correspond to what the other answer is saying: In case RabbitMQ receive non-routable message it drop it.


1 Answers

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/

like image 145
Joseph Avatar answered Sep 21 '22 22:09

Joseph