The scenario is the following: I create exchange e1, create queue q1 and add a binding between the two. If I destroy the queue, the bindings count for the exchange will be 0 and the exchange will call connection.exchangeClosed which then deletes the exchange from connection.exchanges. The exchange hasn't been really closed, and obviously trying to connection.exchanges['e1'].publish will result in an error.
Even if the queue is deleted, it should be still possible to use the exchange and publish messages to it. The exchange may be bound to another queue in another application, etc.
The scenario is the following: I create exchange
e1
, create queueq1
and add a binding between the two. If I destroy the queue, the bindings count for the exchange will be 0 and the exchange will callconnection.exchangeClosed
which then deletes the exchange fromconnection.exchanges
. The exchange hasn't been really closed, and obviously trying toconnection.exchanges['e1'].publish
will result in an error.Even if the queue is deleted, it should be still possible to use the exchange and publish messages to it. The exchange may be bound to another queue in another application, etc.