Skip to content

Instantly share code, notes, and snippets.

@pilate
Created November 6, 2012 17:04
Show Gist options
  • Save pilate/4026050 to your computer and use it in GitHub Desktop.
Save pilate/4026050 to your computer and use it in GitHub Desktop.
Empty existing RabbitMQ Queue
import pika, json
# Clear the RMQ
def callback(ch, method, properties, body):
pass
connection = pika.BlockingConnection(pika.ConnectionParameters('localhost'))
channel = connection.channel()
channel.queue_declare(queue='Phantom')
channel.basic_consume(callback, queue='Phantom', no_ack=True)
connection.close()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment