Last active
September 11, 2016 21:43
-
-
Save koolhead17/a55730354a4d4e1b9e289adf1e22eeba to your computer and use it in GitHub Desktop.
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
| #!/usr/bin/env python | |
| import pika | |
| connection = pika.BlockingConnection(pika.ConnectionParameters( | |
| host='localhost')) | |
| channel = connection.channel() | |
| channel.exchange_declare(exchange='bucketevents', | |
| type='fanout') | |
| result = channel.queue_declare(exclusive=False) | |
| queue_name = result.method.queue | |
| channel.queue_bind(exchange='bucketevents', | |
| queue=queue_name) | |
| print(' [*] Waiting for logs. To exit press CTRL+C') | |
| def callback(ch, method, properties, body): | |
| print(" [x] %r" % body) | |
| channel.basic_consume(callback, | |
| queue=queue_name, | |
| no_ack=False) | |
| channel.start_consuming() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment