Created
February 26, 2013 21:07
-
-
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
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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