Created
April 4, 2017 08:33
-
-
Save DmitryBe/a64f81b209f55523bf7162565404b1b4 to your computer and use it in GitHub Desktop.
rabbit mq python simple client
This file contains hidden or 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
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