Pika reconnect to RabbitMQ if connection closed #6

Sapphire64 opened this Issue May 6, 2013 · 5 comments


None yet

3 participants


Hi there again :) When I'm restarting AMQP server I have this exception on the tornado side when trying to publish a task:

     File "handlers/base.py", line 109, in push_task                                                                                          
      File "venv/lib/python2.7/site-packages/celery/app/task.py", line 473, in apply_async                                                                     
      File "venv/lib/python2.7/site-packages/celery/app/amqp.py", line 249, in publish_task                                                                    
      File "build/bdist.linux-x86_64/egg/tcelery/producer.py", line 52, in publish                                                                                               
        exchange=exchange, declare=declare)                                                                                                                                      
      File "build/bdist.linux-x86_64/egg/tcelery/connection.py", line 64, in publish                                                                                             
      File "venv/lib/python2.7/site-packages/pika/channel.py", line 288, in basic_publish                                                                      
        raise exceptions.ChannelClosed()                                                                                                                                         

We don't have any methods for auto-reconnect? By default Celery tries to reconnect to RabbitMQ if connection is lost. I've found some good examples in pika docs how to implement reconnection: https://github.com/pika/pika/blob/master/docs/examples/asynchronous_consumer_example.rst

mher commented May 6, 2013

You are right, the reconnection is not implemented. Can you open a pull request?


Okay, give me some time and I will take a look :)

@mher mher added a commit that referenced this issue May 21, 2013
@mher Adds Anton Vlasenko to authors #6 1fda432
rbu commented Jul 4, 2013

This issue could be closed.
In addition, this seems to be an important bugfix, can you consider pushing a new release?

rbu commented Jul 4, 2013

See also my comment at ab24794#commitcomment-3565240

mher commented Aug 8, 2013

tornado-celery 0.3.0 is released. https://pypi.python.org/pypi/tornado-celery/0.3.0

@mher mher closed this Aug 8, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment