Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

RabbitMQ Queue peeking

Tags:

rabbitmq

I am new to RabbitMQ and I have a question on get messages option in management plugin. It says "Clicking 'Get Message(s)' will consume messages from the queue. If requeue is set, the message will be re-added to the queue, but ordering will not be preserved and 'redelivered' will be set."

This article says

In the next version of rabbit (after v2.6.1) the order will not be destroyed when requeueing messages. Messages will be requeued to the front of the queue, meaning that you can "peek" at the head of the queue. You can make use of the management interface or use an AMQP client to do this.

So why management plugin says the ordering will not be preserved? I am just trying to understand which is one correct?

Thanks


I got a reply from RabbitMQ team. Here is what they say...

On 25/04/13 01:05, Prazzy wrote:

So why management plugin says the ordering will not be preserved? I am just trying to understand which is one correct?

The management plugin did not get updated it seems. I'll fix that. Thanks for pointing it out.

Cheers, Simon

-- Simon MacMullen RabbitMQ, VMware

like image 822
Prazzy Avatar asked Apr 25 '13 15:04

Prazzy


1 Answers

The management plugin is wrong.

As the response from the RabbitMQ team said, the answer to your question is that the management plug-in is mistaken. The behavior was changed in 2.6.1 to re-queue messages to as close to the original order as possible - which in this case would almost certainly be at the head of the queue.

Beware of side-effects.

As this answer points out, however, "peeking" is a rather mild-sounding term for what is actually happening: a message is (however briefly) being removed from the queue, then put back. During this brief span of time, it is possible that another message will be delivered to a consumer, in which case your "peeked" message will still go back to the head, but messages may be processed out of order.

like image 160
theMayer Avatar answered Oct 05 '22 18:10

theMayer