带有rabbitmq的芹菜创建结果多个队列 [英] Celery with rabbitmq creates results multiple queues

查看:27
本文介绍了带有rabbitmq的芹菜创建结果多个队列的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经用 RabbitMQ 安装了 Celery.问题是对于返回的每个结果,Celery 都会在 Rabbit 中创建,并在交换 celeryresults 中使用任务 ID 排队.

I have installed Celery with RabbitMQ. Problem is that for every result that is returned, Celery will create in the Rabbit, queue with the task's ID in the exchange celeryresults.

我仍然想要结果,但在 ONE 队列中.

I still want to have results, but on ONE queue.

我的芹菜配置:

from datetime import timedelta
OKER_URL = 'amqp://'
CELERY_RESULT_BACKEND = 'amqp'
#CELERY_IGNORE_RESULT = True
CELERY_TASK_SERIALIZER = 'json'
CELERY_RESULT_SERIALIZER = 'json'
CELERY_ACCEPT_CONTENT=['json', 'application/json']
CELERY_TIMEZONE = 'Europe/Oslo'
CELERY_ENABLE_UTC = True

from celery.schedules import crontab

CELERYBEAT_SCHEDULE = {
    'every-minute': {
        'task': 'tasks.remote',
        'schedule': timedelta(seconds=30),
        'args': (),
    },
}

这可能吗?怎么样?

谢谢!

推荐答案

amqp 后端为每个任务创建一个新队列.或者,有一个新的 rpc 后端将结果保存在一个队列中.

amqp backend creates a new queue for each task. Alternatively, there is a new rpc backend which keeps results in a single queue.

http://docs.celeryproject.org/en/master/whatsnew-3.1.html#new-rpc-result-backend

这篇关于带有rabbitmq的芹菜创建结果多个队列的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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