Skip to content

Instantly share code, notes, and snippets.

@arthur-tacca
Created September 15, 2016 14:18
Show Gist options
  • Save arthur-tacca/d3d05bdf5640807a46deda95a131d5bf to your computer and use it in GitHub Desktop.
Save arthur-tacca/d3d05bdf5640807a46deda95a131d5bf to your computer and use it in GitHub Desktop.
Example of bug in pika code for bug report
#!/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