[rabbitmq-discuss] NotImplementedError: <class 'pika.spec.CancelOk'>
Matt Pietrek
mpietrek at hotmail.com
Tue Aug 16 00:36:11 BST 2011
I'm getting the following error from code that used to work without
error until I did an "apt-get upgrade" today.
This is an Ubuntu 11.04 system running Python 2.7 and Pika 0.95. Any
clues what's happening?
Traceback (most recent call last):
File "/usr/lib/python2.7/threading.py", line 552, in
__bootstrap_inner
self.run()
File "ConfigMgr.py", line 101, in run
self.channel.start_consuming()
File "/usr/local/lib/python2.7/dist-packages/pika/adapters/
blocking_connection.py", line 293, in start_consuming
self.transport.connection.process_data_events()
File "/usr/local/lib/python2.7/dist-packages/pika/adapters/
blocking_connection.py", line 94, in process_data_events
self._handle_read()
File "/usr/local/lib/python2.7/dist-packages/pika/adapters/
base_connection.py", line 162, in _handle_read
self._on_data_available(data)
File "/usr/local/lib/python2.7/dist-packages/pika/connection.py",
line 599, in _on_data_available
self._channels[frame.channel_number].transport.deliver(frame)
File "/usr/local/lib/python2.7/dist-packages/pika/channel.py", line
64, in deliver
self.frame_dispatcher.process(frame)
File "/usr/local/lib/python2.7/dist-packages/pika/frame.py", line
202, in process
self._handler(frame)
File "/usr/local/lib/python2.7/dist-packages/pika/frame.py", line
220, in _handle_method_frame
raise NotImplementedError(frame.method.__class__)
NotImplementedError: <class 'pika.spec.CancelOk'>
Here's what my code looks like:
class ListenForLongRunningEventCompletion(threading.Thread):
def run(self):
self.connection =
pika.BlockingConnection(pika.ConnectionParameters(host=MQ_BINDING))
self.channel = self.connection.channel()
self.channel.queue_declare(queue=RESPONSE_QUEUE_NAME)
self.channel.basic_consume(ResponseCallback,
queue=RESPONSE_QUEUE_NAME,
no_ack=True)
self.channel.start_consuming()
def shutdown(self):
self.channel.stop_consuming()
def ResponseCallback(ch, method, properties, body):
print "Long Running Task response({0})".format(body)
#==============================================================================
#
# Main program
#
#==============================================================================
if __name__ == '__main__':
listener = ListenForLongRunningEventCompletion()
listener.start()
# Main app logic - not important here
# Shut down the connections we've opened up
listener.shutdown()
More information about the rabbitmq-discuss
mailing list