[rabbitmq-discuss] Question on ordering of basic.return and CommitOK.

Matt Pietrek mpietrek at skytap.com
Tue Sep 4 17:52:28 BST 2012


I've recently added support in my (Pika-based) code for returned message
support. It's generally working as expected, but there's one question about
the ordering of data from the broker.

The scenario: I'm publishing a message to a non-existent queue. My channel
is in transaction mode, so I'm calling channel.tx_commit() after
channel.basic_publish. I've registered a callback handler for return
messages ( channel.add_on_return_callback() )

What I'm seeing is that the basic.return message comes back from the broker
and enters my callback *before* the channel.tx_commit() returns.
Conceptually I'm fine with this. My understanding is that the basic_return
from the broker is expected to be asynchronous.

However, my question is: Is this ordering guaranteed? Can/will the broker
always send the basic.return before sending the commitOK message? Or could
a client see a CommitOK indicating the broker has the message, and then 10
seconds later see the basic.return?

Thanks,

Matt
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rabbitmq.com/pipermail/rabbitmq-discuss/attachments/20120904/63213eaf/attachment.htm>


More information about the rabbitmq-discuss mailing list