Purging an AMQP queue
Aug 23, 2012
Dick Brouwer
1 minute read

Clearing a RabbitMQ (AMQP) queue is not as straightforward as it should be. Python’s amqplib makes this a bit easier:

from amqplib import client_0_8 as amqp
conn = amqp.Connection(host="localhost:5672", userid="<user>", password="<passwd>", virtual_host="<vhost>", insist=False)
conn = conn.channel()
conn.queue_purge("<queue_name>")


comments powered by Disqus