주제 교환을 설정하려면 내 구성이 어떻게되어 있는지 혼동 스럽습니다. 다음Celery와 RabbitMQ를 이용한 주제 교환
Task1 -> send to QueueOne and QueueFirehose
Task2 -> sent to QueueTwo and QueueFirehose
을 :
http://www.rabbitmq.com/tutorials/tutorial-five-python.html
이것은 내가 달성하고 싶은 것입니다
Task1 -> consume from QueueOne
Task2 -> consume from QueueTwo
TaskFirehose -> consume from QueueFirehose
가 난 단지 작업 1이 QueueTwo에서 소비 QueueOne 및 Task2에서 소비하고 싶다.
이제 Task1과 2가 실행될 때 QueueFirehose가 고갈되고 TaskFirehose 작업이 실행되지 않습니다.
내 설정에 문제가 있습니까? 아니면 내가 잘못 이해하고 있습니까?
Task1 -> send to QueueOne
Task2 -> sent to QueueTwo
TaskFirehose -> send to QueueFirehose
다음 :
Worker1 -> consume from QueueOne, QueueFirehose
Worker2 -> consume from QueueTwo, QueueFirehose
WorkerFirehose -> consume from QueueFirehose
이것은 당신이 무엇을 의미하는지 정확히 일치하지 않을 수 있습니다,하지만 난 그것을 많은 시나리오를 커버해야한다고 생각하고
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.#',
},
}
어쩌면 이것은 단지 용어 일 뿐이지 만 사용자가 작업과 직원이 분쟁중인 것처럼 들릴 수 있습니다. 예를 들어, "Task2가 Queue2로 보낸"이라고 말한 다음 나중에 "Task2를 사용하여 Queue2에서 소비"라고 말합니다. 작업은 사용하지 않습니다. 그들은 (노동자들에 의해) 소비된다. 또한 "TaskFirehose 작업을 실행하지 마십시오"라고 말하지만 설명에 따르면 TaskFirehose가 대기열로 보내지지 않습니다. 기본 개념은 다음과 같습니다. 작업자는 할당 된 대기열에서 작업을 실행합니다. 작업! = 그들을 실행하는 작업자. –