Description of Test: Publish to test1, then consume from test1 and
test2.
What Happens: The queue with the message begins consuming before I
have even told it to start_consuming. Pika seems to get into a weird
state, and then throws a Queue.DeclareOk KeyError.
"""
In Callback Hello World
Traceback (most recent call last):
File "./rabbittests.py", line 31, in <module>
channel.queue_declare(queue=queue_name)
File "/usr/local/lib/python2.6/dist-packages/pika/spec.py", line
2437, in queue_declare
[Queue.DeclareOk])
File "/usr/local/lib/python2.6/dist-packages/pika/adapters/
blocking_connection.py", line 221, in rpc
frame = self._frames[reply]
KeyError: 'Queue.DeclareOk'
"""
The Code:
#!/usr/bin/python
import pika
######### Producer Code
connection =
pika.BlockingConnection(pika.ConnectionParameters('localhost'))
channel = connection.channel()
for queue_name in ('test1', 'test2'):
channel.queue_declare(queue=queue_name)
channel.basic_publish(exchange='', routing_key='test1', body='Hello
World')
connection.close()
######### Consumer Code
connection =
pika.BlockingConnection(pika.ConnectionParameters('localhost'))
channel = connection.channel()
def callback(ch, method, properties, body):
print "In Callback", body
ch.basic_ack(delivery_tag = method.delivery_tag)
for queue_name in ('test1', 'test2'):
channel.queue_declare(queue=queue_name)
channel.basic_consume(callback, queue=queue_name)
assert False # NOTE: this doesn't execute!
channel.start_consuming()
_______________________________________________
rabbitmq-discuss mailing list
rabbitmq...@lists.rabbitmq.com
https://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss
Wasn't able to find where to post issues before (wasn't listed on
http://tonyg.github.com/pika/). Sorry for the cross-post.
Aaron
> rabbitmq-disc...@lists.rabbitmq.comhttps://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss
Wasn't able to find where to post issues before (wasn't listed on
http://tonyg.github.com/pika/). Sorry for the cross-post.
On Sep 21, 4:38 pm, Tony Garnock-Jones <tonygarnockjones
+rabbi...@gmail.com> wrote:
> On 21 September 2011 19:31, Aaron Voelker <aa...@contextlogic.com> wrote:
>
> > Wasn't able to find where to post issues before (wasn't listed on
> >http://tonyg.github.com/pika/). Sorry for the cross-post.
>
> Hmm! Those pages shouldn't be there anymore.http://pika.github.com/is the
> new URL. Your point still stands about there not being any pointers to the
> GH issue tracker, of course :-)
>
> Regards,
> Tony
>