Celery与RabbitMQ:AttributeError:'DisabledBackend'对象没有属性'_get_task_meta_for' [英] Celery with RabbitMQ: AttributeError: 'DisabledBackend' object has no attribute '_get_task_meta_for'

查看:114
本文介绍了Celery与RabbitMQ:AttributeError:'DisabledBackend'对象没有属性'_get_task_meta_for'的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在运行 Celery教程的第一步

我们定义以下任务:

from celery import Celery

app = Celery('tasks', broker='amqp://guest@localhost//')

@app.task
def add(x, y):
    return x + y

然后将其命名为:

>>> from tasks import add
>>> add.delay(4, 4)

但是出现以下错误:

AttributeError: 'DisabledBackend' object has no attribute '_get_task_meta_for'

我同时在运行celery worker和Rabbit-mq服务器。奇怪的是,芹菜工人将任务报告为成功:

I'm running both the celery worker and the rabbit-mq server. Rather strangely, celery worker reports the task as succeeding:

[2014-04-22 19:12:03,608: INFO/MainProcess] Task test_celery.add[168c7d96-e41a-41c9-80f5-50b24dcaff73] succeeded in 0.000435483998444s: 19 

为什么这样不起作用?

推荐答案

只要继续阅读教程即可。将在保留结果中进行说明。 一章。

Just keep reading tutorial. It will be explained in Keep Results chapter.

要启动Celery,您只需要提供broker参数即可,该参数是发送有关任务的消息所必需的。如果要检索有关已完成任务返回的状态和结果的信息,则需要设置backend参数。您可以在配置文档:CELERY_RESULT_BACKEND <中找到完整的列表及其说明。 / a>。

To start Celery you need to provide just broker parameter, which is required to send messages about tasks. If you want to retrieve information about state and results returned by finished tasks you need to set backend parameter. You can find full list with description in Configuration docs: CELERY_RESULT_BACKEND.

这篇关于Celery与RabbitMQ:AttributeError:'DisabledBackend'对象没有属性'_get_task_meta_for'的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆