[rabbitmq-discuss] keep unacked message at the head of queue

Matthias Radestock matthias at lshift.net
Tue Jan 26 07:23:23 GMT 2010


Alex,

alex chen wrote:
> Currently rabbitmq re-queues the unacked messages to the end of
> queue.  Is it possible to keep those messages at the head of queue
> instead?

No, that isn't possible.

> Our application needs to keep the ordering of the messages.

The ordering guarantees provided by AMQP are very constrained. See 
section 4.7 of the AMQP 0-9-1 spec which, for example, states that all 
bets are off when messages get redelivered.

There are good reasons for being so restrictive: excessive ordering 
guarantees are bad for scalability. Also, it is actually logically 
impossible to maintain message order in all but the simplest scenarios. 
For example, even just adding a second consumer to a queue necessarily 
breaks the order of redeliveries wrt other messages.


Regards,

Matthias.




More information about the rabbitmq-discuss mailing list