RabbitMQ - Delete Queue using the rabbitmqctl command

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

Add a Comment




We will never share your name or email with anyone. Enter your email if you would like to be notified when we respond to your comment.





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




Comments

Web design by yours truely - me, myself, and I   |   jeremy.canfield@freekb.net   |