[rabbitmq-discuss] python publish an unroutable message

Ovidiu Deac ovidiudeac at gmail.com
Wed Jul 21 19:14:29 BST 2010

Unfortunately, based on the number of available developers, the
decision was to use C# instead of Python but anyway, thanks for the


On Wed, Jul 21, 2010 at 3:41 PM, Marek Majkowski <majek04 at gmail.com> wrote:
> On Tue, Jul 20, 2010 at 12:42, Ovidiu Deac <ovidiudeac at gmail.com> wrote:
>>> Ovidiu Deac <ovidiudeac at gmail.com> writes:
>>>> Does anyone have an example of using the mandatory flag to detect
>>>> unroutable messages in python?
> Pika: raises an exception on basic.return
> look at pika/channel.py:
>    def _async_basic_return(self, method_frame, header_frame, body):
>        raise NotImplementedError("Basic.Return")
> Pyamqplib: looks like it appends returned message to an internal queue:
> http://code.google.com/p/py-amqplib/source/browse/amqplib/client_0_8/channel.py#2426
> That _basic_return code is executed only when you do ch.wait. This kind
> of flow works for me:
> ch.returned_messages.empty() -> True
> ch.basic_publish(...)
> ch.wait()
> ch.returned_messages.empty() -> False
> On the other hand ch.returned_messages is a standard python Queue.Queue,
> so it might be safe to just block on it in a separate thread.
> Cheers,
>  Marek

More information about the rabbitmq-discuss mailing list