[rabbitmq-discuss] Ordering of messages after txRollback()
Matthew Sackman
matthew at rabbitmq.com
Sun Jun 6 18:32:09 BST 2010
On Sun, Jun 06, 2010 at 09:58:20AM -0700, Oleg Zhurakousky wrote:
> I have a simple test where I receive 20 messages in the order in which they came in, then rollback each and every one of them.
>
> Upon the next attempt to receive messages the order is completely arbitrary. Is this by design?
Yes, pretty much. Not quite sure what you mean by rollback though:
Transactions are only on what you send to the server, not what it sends
to you. I suspect you're not meaning to use transactions and are
actually just closing the connection or channel on which you've done the
consume, which will cause all unacked messages to be requeued. If you
use basic.recover{requeue=true} then the order will be more predictable,
however, that's a facet of the design: the spec is completely silent on
the order, and you should not rely on RabbitMQ doing any particular
ordering.
Matthew
More information about the rabbitmq-discuss
mailing list