Created
September 15, 2016 14:18
-
-
Save arthur-tacca/d3d05bdf5640807a46deda95a131d5bf to your computer and use it in GitHub Desktop.
Example of bug in pika code for bug report
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 python3 | |
import pika | |
from uuid import uuid4 | |
connection = pika.BlockingConnection(pika.ConnectionParameters('localhost')) | |
channel = connection.channel() | |
queue_name = "test_queue_abc" | |
queue_result = channel.queue_declare(queue=queue_name) | |
message_properties = pika.BasicProperties(correlation_id=uuid4().bytes) | |
pub_result = channel.basic_publish(exchange="", routing_key=queue_name, body=b"", | |
properties=message_properties) | |
def callback(channel, method, properties, body): | |
print("Got message:", body) | |
channel.basic_consume(callback, queue=queue_name) | |
channel.start_consuming() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment