我对设置主题交换的配置应该是什么样子有点困惑。
http://www.rabbitmq.com/tutorials/tutorial-five-python.html
这就是我想要完成的:
Task1 -> send to QueueOne and QueueFirehose
Task2 -> sent to QueueTwo and QueueFirehose
然后:
Task1 -> consume from QueueOne
Task2 -> consume from QueueTwo
TaskFirehose -> consume from QueueFirehose
我只希望 Task1 从 QueueOne 消费,而 Task2 从 QueueTwo 消费。
现在的问题是,当 Task1 和 2 运行时,它们也会耗尽 QueueFirehose,而 TaskFirehose 任务永远不会执行。
我的配置有问题,还是我误解了什么?
CELERY_QUEUES = {
"QueueOne": {
"exchange_type": "topic",
"binding_key": "pipeline.one",
},
"QueueTwo": {
"exchange_type": "topic",
"binding_key": "pipeline.two",
},
"QueueFirehose": {
"exchange_type": "topic",
"binding_key": "pipeline.#",
},
}
CELERY_ROUTES = {
"tasks.task1": {
"queue": 'QueueOne',
"routing_key": 'pipeline.one',
},
"tasks.task2": {
"queue": 'QueueTwo',
"routing_key": 'pipeline.two',
},
"tasks.firehose": {
'queue': 'QueueFirehose',
"routing_key": 'pipeline.#',
},
}