[rabbitmq-discuss] Using Pika's add_on_return_callback with a BlockingConnection?

Matt Pietrek mpietrek at skytap.com
Fri Aug 17 23:52:49 BST 2012

I'm got a scenario where I use a dedicated thread to write a series of
messages in a loop. This thread uses BlockingConnection, calls
add_on_return_callback for its channel, and when publishing, uses the
mandatory=True flag.

I want to know when a message is being returned. However, I can't figure
out what to call within my loop to give Pika the opportunity to see the
Basic.Return message and invoke the callback.

I've verified via WireShark that the Basic.Returns are coming back from the
broker. However, I can't figure out what the moral equivalent of calling
ioloop.start() is, so as to give Pika the an opportunity to process the
basic.return messages, but without blocking indefinitely. Just for kicks I
tried calling Channel.basic_get() within the loop, and (as expected), I
didn't get the returned message callbacks.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rabbitmq.com/pipermail/rabbitmq-discuss/attachments/20120817/14fe799f/attachment.htm>

More information about the rabbitmq-discuss mailing list