How to delete a queue in rabbit mq

GUI rabbitMQ mgm't made that easy

$ sudo rabbitmq-plugins enable rabbitmq_management

http://localhost:15672/#/queues

Username : guest

password : guest


inspired by this


The detailed answer is as follows (with reference to above very helpful and useful answer)

import pika


connection = pika.BlockingConnection(pika.ConnectionParameters(
               'localhost'))
channel = connection.channel()


channel.queue_delete(queue='hello')

connection.close()

Since this seems to be a maintenance procedure, and not something you'll be doing routinely on your code, you should probably be using the RabbitMQ management plugin and delete the queue from there.

Anyway, you can delete it from pika with:

channel.queue_delete(queue='hello')

https://pika.readthedocs.org/en/latest/modules/channel.html#pika.channel.Channel.queue_delete

Tags:

Queue

Rabbitmq