[rabbitmq-discuss] Channel.basicPublish to a non-existent exchange does not throw
jhalterman at gmail.com
Mon Oct 21 20:02:20 BST 2013
I noticed that a Channel.basicPublish to a non-existent exchange does not
result in an exception being thrown. It's not clear from the docs whether
this is expected or not, but I assumed an exception would be thrown here
since attempting to get/consume from a non-existent queue results in an
exception be thrown with a similar shutdown reason (404). The channel is
shutdown, but since the Channel's shutdown listener might not be called
immediately my client might not realize that the Channel has been closed
and could attempt another publish which results in the Connection being
shutdown as well.
Should Channel.basicPublish throw when the exchange doesn't exist? If not,
what's the recommended way to determine if a basicPublish resulted in the
Channel being closed (since Channel.isOpen is not recommended for
production use) ?
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the rabbitmq-discuss