[rabbitmq-discuss] Order in Queues (FIFO)

Michael Klishin michael at rabbitmq.com
Fri Oct 4 13:21:16 BST 2013


On oct 4, 2013, at 3:54 p.m., rabbit15 <bison_art at o2.pl> wrote:

> eq. payload sent to rabbit in in order - line: 3, 4, 5
> but receiving is in order line: 6(same msg as 4), 7(same message as 5), 8
> (same message as 3) - which gives payloads order 4,5,3 

RabbitMQ queues are FIFO but there are several factors that
you need to take into account:

 * Messages can be requeued
 * There can be multiple consumers per queue
 * Multiple messages can be pushed to a consumer in rapid succession.
   Deliveries can be dispatched in a thread pool and processed concurrently (this is indeed what several popular clients do)

What code produced the log above? Printing to stdout is not a very reliable way
when it comes to determining the order. Updating a synchronized collection
of some kind and inspecting it is a more reliable way.

MK



-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 495 bytes
Desc: Message signed with OpenPGP using GPGMail
URL: <http://lists.rabbitmq.com/pipermail/rabbitmq-discuss/attachments/20131004/07ea005b/attachment.pgp>


More information about the rabbitmq-discuss mailing list