[rabbitmq-discuss] pika error - need a help

Gavin M. Roy gmr at myyearbook.com
Wed Sep 7 14:04:07 BST 2011



On Wednesday, September 7, 2011 at 7:21 AM, Ann Witbrock (c) wrote:

> 
> 
> From: "Sergey Almazov" <sergey.almazoff at gmail.com (mailto:sergey.almazoff at gmail.com)>
> To: rabbitmq-discuss at lists.rabbitmq.com (mailto:rabbitmq-discuss at lists.rabbitmq.com)
> Sent: Wednesday, 7 September, 2011 6:39:59 AM
> Subject: [rabbitmq-discuss] pika error - need a help
> 
> 
> When I start this code -> have an error: error: uncaptured python exception, closing channel <pika.asyncore_adapter.RabbitDispatcher connected at 0x12ad6c0>
So one of the difficulties with async programming in python is catching exceptions, add in some interesting aspects of AMQP and knowing what has happened where can be difficult. If you could provide a traceback beyond the exception it would be helpful.

You may be getting a remote close from RabbitMQ. You can check your rabbitmq logs to see and you can handle it in your code.

I would suggest adding an on channel close callback (this is rough untested code):

from pika import spec

def my_callback_function(frame):
 print frame.method.reply_code
 print frame.method.reply_text

callback_manager = connection.callbacks.add(channel.channel_number, spec.Channel.Close, my_callback_function)





-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rabbitmq.com/pipermail/rabbitmq-discuss/attachments/20110907/5666c47e/attachment.htm>


More information about the rabbitmq-discuss mailing list