在 RabbitMQ 服务器中生成具有随机 GUID 的队列

Queues with random GUID being generated in RabbitMQ server

正在从交换 'celeryresults' 生成具有随机 GUID 的队列。

这发生在我使用延迟方法从 shell 启动任务时,但我忘记在延迟的参数列表中输入我的原始函数的参数。

在我 运行 芹菜工人所在的终端中显示错误:

[2015-02-20 18:42:48,547: ERROR/MainProcess] Task customers.tasks.sendmail_task[1a4daf49-81bf-4122-8dea-2ee76c2a2ff8] raised unexpected: TypeError('sendmail_task() takes exactly 4 arguments (0 given)',)
Traceback (most recent call last):
  File "/home/cod/workspace/envs/cod/lib/python2.6/site-packages/celery/app/trace.py", line 240, in trace_task
R = retval = fun(*args, **kwargs)
File "/home/cod/workspace/envs/cod/lib/python2.6/site-packages/celery/app/trace.py", line 438, in __protected_call__
return self.run(*args, **kwargs)
TypeError: sendmail_task() takes exactly 4 arguments (0 given)

如何停止生成随机队列?为什么这些消息不使用默认队列?

broker(sends/receives 消息)和 backend(stores/fetches 任务结果之间存在差异)在芹菜中。听起来您正在使用 RabbitMQ 作为消息代理和结果后端。

当 RabbitMQ 被用作结果后端时,celery 为每个任务创建一个队列以临时跟踪结果。这在文档的 RabbitMQ Result Backend 部分中有描述。

如果您不想要这种行为,那么您应该使用 CELERY_IGNORE_RESULT or switch to one of the other backend implementations listed in the Result Backend Settings.

将其关闭