[rabbitmq-discuss] Message order of delivery

Jesper Louis Andersen jesper.louis.andersen at gmail.com
Sun Jan 26 17:13:13 GMT 2014


On Sun, Jan 26, 2014 at 1:27 PM, Mysurf Mail <stammailbox at gmail.com> wrote:

> So, if I need to handle messages by their Order, I can only use rabbitMQ
> with an exclusive queue  to each consumer? Is RabbitMQ still considered a
> good solution for ordered message queuing?


Example: We deliver messages to the queue Q and we have a single subscriber
S1.

Message delivery will be made in order to S1. Unless precisely this happens:

* S1 rejects a message which puts it back in the end of the queue
* S1 closes the connection while having unacknowledged messages

If we add another subscriber S2 to Q, things are more complicated. Messages
are processed through the queue in order, but now both S1 and S2 may get
messages. There are no guarantee that they are equally fast at processing
messages, so depending on what S1 and S2 does, they may overrun each other.

The consequence is that either you need to have a queue per subscriber and
deliver them to these, or you need to model an ordering primitive into your
solution. I usually advocate against using timestamps for this since they
drift. A better model would be to make messages idempotent.


-- 
J.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rabbitmq.com/pipermail/rabbitmq-discuss/attachments/20140126/b775cb1a/attachment.html>


More information about the rabbitmq-discuss mailing list