Skip to content

Instantly share code, notes, and snippets.

@mk270
Created February 26, 2013 21:07
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mk270/5042215 to your computer and use it in GitHub Desktop.
Save mk270/5042215 to your computer and use it in GitHub Desktop.
trivial tool for delete AMQP queues, as Debian squeeze doesn't seem to have my favourite one
#!/usr/bin/env python
import pika
import sys
from optparse import OptionParser
def run():
p = OptionParser()
p.add_option("--hostname", dest="hostname",
default="localhost", help="Hostname of AMQP endpoint")
options, args = p.parse_args()
if len(args) != 1:
p.error("You must specify the queue")
queue = args[0]
connection = pika.BlockingConnection(
pika.ConnectionParameters(host=options.hostname))
channel = connection.channel()
channel.queue_delete(queue=queue)
if __name__ == '__main__':
run()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment