Skip to content

Instantly share code, notes, and snippets.

@pilate
Created November 6, 2012 16:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pilate/4025942 to your computer and use it in GitHub Desktop.
Save pilate/4025942 to your computer and use it in GitHub Desktop.
Get all queue elements from RabbitMQ with pika
import pika
def callback(ch, method, properties, body):
pass
connection = pika.BlockingConnection(pika.ConnectionParameters('localhost'))
channel = connection.channel()
channel.queue_declare(queue='queue', passive=True)
channel.basic_consume(callback, queue='queue', no_ack=False)
connection.close()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment