postwait / node-amqp

[UNMAINTAINED] node-amqp is an AMQP client for nodejs
MIT License
1.69k stars 357 forks source link

Avoid removing exchange (cleanup) on queue destroy #375

Closed ismriv closed 9 years ago

ismriv commented 9 years ago

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.