Bootstrap FreeKB - RabbitMQ - Delete Queue using the rabbitmqctl command
RabbitMQ - Delete Queue using the rabbitmqctl command

Updated:   |  RabbitMQ articles

The rabbitmqctl command with the delete_queue option can be used to delete a queue. In this example, queue001 will be deleted.

rabbitmqctl delete_queue queue001

 

Something like this should be returned.

tbd

 

IMPORTANT - If the queue contains any bindings, you will probably want to unbind before deleting the queue. The rabbitmqctl list_bindings command can be used to list a queues bindings.

 

The -e or --if-empty option can be included to only delete the queue if it contains 0 messages. Or, the rabbitmqctl list_queues command can be used to list the number of messages in a queue.

rabbitmqctl delete_queue queue001 --if-empty

 

The -u or --if-unused option can be included to only delete the queue if no consumers are using the queue.

rabbitmqctl delete_queue queue001 --if-unused



Did you find this article helpful?

If so, consider buying me a coffee over at Buy Me A Coffee



Comments


Add a Comment


Please enter 88bee4 in the box below so that we can be sure you are a human.