Skip to main content

Posts

Showing posts with the label purge

RabbitMQ purge a queue

Such a simple operation is not available in rabbitmqctl. You can list the queues but not clear it so wrote a python client for it. Better solution is to install BQL plugin but for now this would suffice import sys from amqplib import client_0_8 as amqp if __name__ == '__main__':     if len(sys.argv) < 6:        print "Usage python purge_queue.py mq_url mq_user mq_pass mq_vhost queue_name"        exit()        mq_url=sys.argv[1]     mq_user=sys.argv[2]     mq_pass=sys.argv[3]     mq_vhost=sys.argv[4]     mq_queue_name=sys.argv[5]     conn = amqp.Connection(host=mq_url,                            userid=mq_user,          ...