[rabbitmq-discuss] client disconnection after publish to not exist exchange
emile at rabbitmq.com
Mon Nov 8 12:35:35 GMT 2010
On 08/11/10 11:21, Adam Kaminiecki wrote:
> I'm using few exchanges on version 2.1.1 and sending/receiving messages
> without any porblem but when one of consumer delete exchange and another
> is trying to publish to deleted exchange he gets error: no exchange
> found which is expacted. My question is why the client is disconnected
> from the server?? Its recommended to always use:
> channel.ExchangeDeclare before publish?
The AMQP 0-9-1 spec requires that the broker raise a channel exception
if a publisher attempts to publish to a non-existent exchange.
It is unusual for publishers to deal with the risk of an exchange
disappearing, because exchanges are normally long-lived. Publishers must
be prepared to redeclare exchanges or recover from channel exceptions in
the presence of such risk.
If you explain the reason for consumers deleting exchanges then I may be
able to suggest an alternative messaging pattern.
As a preventative measure you can use permissions to prevent clients
from deleting exchanges, or use server-assigned names to make them
undiscoverable via AMQP.
More information about the rabbitmq-discuss