Skip to content

Instantly share code, notes, and snippets.

@DmitryBe
Created April 4, 2017 08:33
Show Gist options
  • Save DmitryBe/a64f81b209f55523bf7162565404b1b4 to your computer and use it in GitHub Desktop.
Save DmitryBe/a64f81b209f55523bf7162565404b1b4 to your computer and use it in GitHub Desktop.
rabbit mq python simple client
import pika
conn = pika.BlockingConnection(pika.ConnectionParameters(host="10.2.95.5", credentials=pika.PlainCredentials("guest", "guest")))
def callback(ch, method, properties, body):
print(" [x] Received %r" % body)
channel = conn.channel()
channel.basic_consume(callback, queue='cqe.debug', no_ack=True)
channel.start_consuming()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment