简体   繁体   English

为什么 celery 在 rabbit mq 中创建新队列?

[英]why celery is creating new queue in rabbit mq?

在此处输入图像描述

the function that send to celery is using the decorator poinitng to the queue that i want to use such:发送到 celery 的 function 正在使用装饰器指向我想使用的队列:

@app.task(queue="celery")
def compare_from_database(row_id=None, database_name=None, table_name=None):
    ....

i created a script to check how many task i still have in the queue, just a while loop of the command我创建了一个脚本来检查队列中还有多少任务,只是命令的一个while循环

 rabbitmqctl list_queues

and parsing the line with "celery"并用“celery”解析行

but since celery creates random queues i cant use that.但由于 celery 创建随机队列我不能使用它。 why celery is creating new queues and not really sending it to the one i want?为什么 celery 正在创建新队列而不是真正将其发送给我想要的队列?

I guess you are using rpc as your celery_result_backend .我猜你正在使用rpc作为你的celery_result_backend You can check out this link - https://tech.labs.oliverwyman.com/blog/2015/04/30/making-celery-play-nice-with-rabbitmq-and-bigwig/ where he explains that RPC backend will create queues for the task results.您可以查看此链接 - https://tech.labs.oliverwyman.com/blog/2015/04/30/making-celery-play-nice-with-rabbitmq-and-bigwig/他解释说 RPC 后端将为任务结果创建队列。


You can check my answer for more explanation about result-backend here => https://stackoverflow.com/a/62069822/6490744您可以在此处查看我的答案以获取有关result-backend的更多说明=> https://stackoverflow.com/a/62069822/6490744

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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