RabbitMQ pika error

756 views Asked by At

I have this error when I run my program. I have a queue inside a queue because I want my data to be sent separately. Data comes from the database. But I don't think it's the cause of it. There are times when this error is not displaying and there are also times when it does. I have googled it and not much came to my help. But I can receive my data from the 2 queues. Although it stop consuming messages

Traceback (most recent call last):
  File "C:\wamp\www\srctmp\receive_tblname.py", line 30, in <module>
    no_ack=True)
  File "C:\Python27\lib\site-packages\pika\channel.py", line 211, in basic_consume
    {'consumer_tag': consumer_tag})])
  File "C:\Python27\lib\site-packages\pika\adapters\blocking_connection.py", line 905, in _rpc
    return self._process_replies(replies, callback)
  File "C:\Python27\lib\site-packages\pika\adapters\blocking_connection.py", line 859, in _process_replies
    frame_value = self._frames[reply]
KeyError: 'Basic.ConsumeOk'

I am using python 2.7 with pika and RabbitMQ

My question is I was wondering what could be causing this and how to fix it.

EDIT

*insert connection parameters here**
channel = connection.channel()

channel.queue_declare(queue='admin')
print ' [*] Waiting for messages. To exit press CTRL+C'

def callback(ch, method, properties, body):
    print body

    channel.queue_declare(queue='admin_data')
    def queue2(ch, method, properties, body):
        print body
    channel.basic_consume(queue2,
                      queue='admin_data',
                      no_ack=True)

channel.basic_consume(callback,
                      queue='admin',
                      no_ack=True)

channel.start_consuming()
0

There are 0 answers