[rabbitmq-discuss] NotImplementedError: <class 'pika.spec.CancelOk'>

Matt Pietrek mpietrek at hotmail.com
Tue Aug 16 17:18:14 BST 2011


Alas, no luck with a Pika reinstall. I did a "pip uninstall" of what was
there, verified the files were removed, then "pip install".

All other aspects of my Pika-based code seem to work. I'm sending and
receiving 1000's of messages before shutting down. It's only at shutdown
where the problem occurs.

Does my shutdown sequence look OK? That is, calling
channel.stop_consuming() from a different thread than I called
.start_consuming on?



On 8/16/11 4:29 AM, "Marek Majkowski" <majek04 at gmail.com> wrote:

>On Tue, Aug 16, 2011 at 00:36, Matt Pietrek <mpietrek at hotmail.com> wrote:
>> 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?
>
>Nope. Maybe it's just a python installation issue?
>
>Can you try removing pika and installing it again? Or maybe
>installing a fresh local copy (for example using venv)?
>
>Cheers,
>  Marek
>
>> 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()
>> _______________________________________________
>> rabbitmq-discuss mailing list
>> rabbitmq-discuss at lists.rabbitmq.com
>> https://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss
>>
>




More information about the rabbitmq-discuss mailing list