0
votes

RabbitMQ version: 3.8.2 Erlang 22.2

Due to some issues, I had to reinstall RabbitMQ and Erlang on the server.

Despite reinstalling the applications, the queues from the previous instance still exist as well as new queues are being created(queue names given by Guid's, hence unique).

Is this normal behaviour? How do I delete the older queues which have no consumers attached to them? I have ended up with 25,000 queues this way :|

Thank you

2
Can you see the old queues in the Admin console?Frank Nielsen
@FrankNielsen, yes they are all listed in the Queues tab of the consolecaptain_nemo

2 Answers

0
votes

Dependend on your usage of the queues, there is an option auto-delete for deleting the queues.

Queue declare - From doc:

bit auto-delete If set, the queue is deleted when all consumers have finished using it. The last consumer can be cancelled either explicitly or because its channel is closed. If there was no consumer ever on the queue, it won't be deleted. Applications can explicitly delete auto-delete queues using the Delete method as normal.

Read more here: https://www.rabbitmq.com/amqp-0-9-1-reference.html#queue.declare.auto-delete

0
votes

So, I figured it out. Apparently, there is a policy which can be set from the RabbitMQ Dashboard, to delete Inactive Queues.

The policy is expires and it can be set for queues and exchanges(though the policy seems to delete queues only).

This policy deletes all queues after the stipulated time of inactivity(no consumers subscribing to the queue)