I have a service A which does the following:
- Create/Update a Person and publish a create/update event.
- Also save the Person job data in service B's database.
Service B upon saving/updating the data in it's DB, triggers its own create/update event.
Now I am receiving these 2 RabbitMQ events from service A and B in another service C. I have a requirement where I need to make sure that I receive event from service A first and then update a field in that event's data by extracting that data from the event of service B. I have following questions.
Can I assume that as A is producing event before B, in my service C I will always receive A first and then B ?
If not, how can I guarantee that I will always have event of service A before B ?
While doing some initial testing, I can see that I am receiving A first and then B with a difference of like 0.0001 seconds (which is fine). But this seems to be a happy path.
Any help would be appreciated.