Skip to content Skip to sidebar Skip to footer

AMQP Connection Reset By Peer, But Celery Connected

I have a flask app using Celery with RabbitMQ as the broker. I've followed the instructions in this answer to get started. I have two machines. Machine A, where RabbitMQ runs, send

Solution 1:

I also have same requirements, I also followed this tutorial and It's working fine.

Looks like issue in your broker url, Just try to configure in following way :

from celery import Celery

app = Celery('tasks', backend='amqp',
broker='amqp://username:password@yourIp:5672//')

#Test Celery configuration
@app.task
def test(x, y):
    return x + y

And Start worker :

celery worker -l info -A app.celery

Test it :

Python
>>> from app.celery import test
>>> test.delay(3,4)
<AsyncResult: 68480bd4-ebda-4238-87b1-ad896a75a12c>

and check your terminal you will get expected output.

Note: I don't know it will be work for you or not. I did this and it's working fine for me.


Post a Comment for "AMQP Connection Reset By Peer, But Celery Connected"