[rabbitmq-discuss] Publishing to a non-existing exchange

David Wragg david at rabbitmq.com
Wed May 5 16:38:14 BST 2010


Hi Andrei,

Andrey P <andrey at sent.com> writes:
> Testing the the version 1.7.2 I found that if a message is published to a
> non-existing exchange, the basicPublish method completes without exceptions,
> but instead the whole channel gets shut down after a moment. Is this a right
> behavior? Is there any way to keep the channel alive in these circumstances?

It's defined to work that way by AMQP (at least in version 0.8 of the
protocol, as implemented by RabbitM 1.7.2; I'm not closely familiar
with later versions of the protocol, but I expect one of my colleagues
will comment if the situation changes significantly in later protocol
versions).

An AMQP client sends basic.publish to the server without waiting for a
response.  If the exchange does not exist, the 0.8 spec says that this
is reported by raising a channel exception.  This involves the server
sending a channel.close to the client, with fields indicating the
nature of the exception, i.e. by closing the channel.

David

-- 
David Wragg
Staff Engineer, RabbitMQ
SpringSource, a division of VMware



More information about the rabbitmq-discuss mailing list