[rabbitmq-discuss] Un used connections at broker

Michael Klishin mklishin at gopivotal.com
Mon Feb 3 11:02:14 GMT 2014

On 3 Feb 2014, at 14:47, Lothe Shashank <Shashank.Lothe at techmahindra.com> wrote:

> I have few queries regarding RMQ broker behaviour. The sequence is as follows.
> 1. A client created a connection (Connection A) and a queue (Queue A) (auto-delete, non exclusive, non durable) on a broker.
> 2. After some time I created one more connection (Connection B) and I deleted the queue Queue A. I did not destroy Connection A and is unused henceforth.
> My queries are as follows.
> 1. What happens to the unused connection A? Will it be deleted by Broker eventually?

No. Consumers on connection A will receive a consumer cancel notification:

> 2. Will the resources allocated by connection A be deallocated by the broker?

See above.

> 3. If I create n number of connections which are unused will the performance of broker be affected?

Up to a certain point (say, a few hundreds) the effect will be irrelevant. If you leave unused
connections open, however, eventually you may run out of available file descriptors and RabbitMQ will
stop accepting new connections.

> 4. Will garbage collector detect the unused connection?

There is no garbage collection for inactive connections.

> One more sequence I would like to mention.
> 1. A client created a connection (Connection A) and a queue (Queue A) (auto-delete, non exclusive, non durable) on a broker.
> 2. I pulled out power cable/network cable from the client.
> 3. I am not sure if the broker has detected the connection failure with client as the queue A created at the broker is not deleted

Yes, RabbitMQ will eventually detect connection failure. It will take some time, due to how TCP works.

Connections in RabbitMQ are orthogonal to queues. I’d recommend reading
http://www.rabbitmq.com/tutorials/amqp-concepts.html and other tutorials:

in case you are not sure about the concepts.


Software Engineer, Pivotal/RabbitMQ

More information about the rabbitmq-discuss mailing list