We need to trigger an another event when two independent async events are completed. We are publishing individual rabbitmq messages on the completion of each async event. I went through RabbitMQ documentation but did not find a way to handle this elegantly.
Scenario:
- Task A completed
- Task B completed
Start task C only if A & B are completed.
Is there any design pattern that can help me here ? Anything outside RabbitMQ is also fine. We would like to achieve this without polling. Tasks are totally independent happening in 3 different systems.
Can celery help in this?
We implemented this using Aggregator pattern in RabbitMQ itself.
http://www.enterpriseintegrationpatterns.com/patterns/messaging/Aggregator.html
We created a topic (aggregator). Task A and Task B are subscribed to it. Whenever any of the task gets completed, message is being pushed to the topic. Topic is maintaining the state of taskA and taskB and publishes another message once both tasks are completed.