简体   繁体   中英

Not able to run celery tasks from python shell

I am trying to run celery tasks asynchronously using the.delay() from python shell inside my local machine, The celery uses the rabbitmq as broker and both the celery and rabbitmq servers are running inside 2 different docker containers. The issue here is the celery workers are not connecting to rabbitmq servers

This is the config I'm using here

# celery config
    CELERY_ALWAYS_EAGER = False
    #Default config
    CELERY_BROKER = "amqp://rabbitmq:5672"

    #default config
    CELERY_RESULT_BACKEND = "redis://redis:6379/15"

The docker containers are port mapped to the respective ports of the host machine.

I think your backend configuration should also be of Rabbitmq. Please try to incorporate the below code for backend. Hope that should help: CELERY_RESULT_BACKEND = ='rpc://'

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM