[rabbitmq-discuss] Exchange disappear

Marek Majkowski majek04 at gmail.com
Thu Nov 24 14:59:47 GMT 2011

On Thu, Nov 24, 2011 at 14:18, Rosa, Andrea <andrea.rosa at hp.com> wrote:
>> -----Original Message-----
>> From: Marek Majkowski [mailto:majek04 at gmail.com]
>> Sent: 24 November 2011 12:24
>> To: Rosa, Andrea
>> Cc: rabbitmq-discuss at lists.rabbitmq.com
>> Subject: Re: [rabbitmq-discuss] Exchange disappear
>> >> Make sure the exchange exists at that point - maybe put
>> >> `exchange_declare`
>> >> before the `publish` ?
>> >>
>> >
>> > I am sure that the publish command is called after the
>> exchange_declare, because I can see the process work correctly for the
>> 95% of my messages, but sometimes I have got this error.
>> > Maybe some race condition?
>> Quite possible - but rather on the client side. Just a quick question:
>> you're not using `no_wait`, right?
> no_wait=False


>> > The exchange has auto_delete=true, so maybe a possible scenario could
>> be:
>> > 1 try to publish a message
>> > 2 the exchange is not yet created
>> That is going to crash the AMQP channel, you can't publish to non-
>> existing
>> exchange.
> The channel can crash for some network problems or some issues with the socket, isn't it?

Or when any AMQP error occurs. Closing channels is the AMQP way
of signalling errors.

In case of socket/network problems you will hear connection error
(as opposed to channel error).

IE: "channel error" is almost always caused by application doing
AMQP things its not supposed to do.

>> > 3 second attempt to publish a message which generates the second
>> exception (503)
>> > 4 the message is not published and the exchange is created.
>> > I verified also that that exchange has not a binding.
>> Publishing to existing exchange will always succeed, bindings doesn't
>> make
>> a difference.
>> `auto-delete` exchange is deleted when last queue unbinds, is that
>> what you're doing?
> Yes, that's my case

Well, in such case on `unbind` (or when queues are deleted or auto-deleted)
the exchange will be removed and any subsequent publishes will fail
with "channel errors".

Hope that helps,

More information about the rabbitmq-discuss mailing list