我有点困惑,我的配置应该是什么样子来建立一个主题交换。在
http://www.rabbitmq.com/tutorials/tutorial-five-python.html
这就是我想要完成的:
Task1 -> send to QueueOne and QueueFirehose
Task2 -> sent to QueueTwo and QueueFirehose
然后:
^{pr2}$我只希望Task1从QueueOne消费,Task2从queue2消费。在
现在的问题是,当Task1和task2运行时,它们也会耗尽queuefirehouse,taskfirehouse任务永远不会执行。在
是我的配置有问题,还是我误解了什么?在
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.#',
},
}
假设你的意思是这样的:
然后:
^{pr2}$这可能不完全是你的意思,但我认为它应该涵盖很多场景,希望你也能。 这样的方法应该有效:
更多选项和参考:http://celery.readthedocs.org/en/latest/reference/celery.bin.multi.html
这是直接从文档中得到的。在
我也遇到了类似的情况,我用了一种稍微不同的方式来处理它。我不能和主管一起用芹菜。 所以我在supervisord中为每个工人创建了多个程序。不管怎样,工人们都会在不同的工序上工作,所以让主管来帮你处理一切。 配置文件看起来像比如:在
同样,对于Worker2和WorkerFirehose,编辑相应的行以使:
以及
把他们都包括在内监督人.conf文件,这样就可以了。在
相关问题 更多 >
编程相关推荐