[rabbitmq-discuss] Queue Ordering after restart
rathi
riteshrathi at gmail.com
Wed Dec 1 15:41:53 GMT 2010
In the rabbitmq documentation it is said
*
*
*I have read that RabbitMQ preserves the order of messages in queues. Is
this correct?*
*For the most part, yes. Say a publisher publishes messages M1, M2, M3 and
M4 (in that order) on the same channel and with the same routing
information. If these messages are routed to a queue then they will end up
in the same order that they were published. Consuming on the queue will
yield M1, M2, M3 and then M4.*
*However, the order is only guaranteed in the absence of requeuing. A
message will be implicitly requeued if a consumer closes the channel before
ack'ing a message. For example, if a consumer receives M1, fails to ack and
closes the channel then the next consumer will receive messages in the order
M2, M3, M4, M1. Messages can also be explicitly requeued if the consumer
calls basic.recover{requeue=true}. The FAQ on at least once
delivery<http://www.rabbitmq.com/faq.html#at-least-once-delivery>talks
about this in some more detail.
*
I have only one consumer which should process messages in the order they are
published. If my consumer gets M1 and crashes without acknowledging M1, then
when I restart my consumer I want to process messages in the same order as
they were published. Can this be achieved ?
thanks & regards,
ritesh rathi
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rabbitmq.com/pipermail/rabbitmq-discuss/attachments/20101201/66a4f3cc/attachment.htm>
More information about the rabbitmq-discuss
mailing list