Consider there are 3 microservices - s1, s2 and s3.
s1 sends message m1.
s2 consumes message m1, applies some business logic and then sends message m2.
The problem is that s3 receives message m2 before message m1.
I tried to find a solution over internet, but I have not been able to find any proper articles or resources on this.
How to solve this problem of out-of-order messages ?
UPDATE:
- Martin kleppmann explained this problem statement here - youtu.be/OKHIdpOAxto?feature=shared
- In this video youtu.be/A8oamrHf_cQ?si=ecBkcA_k67OGgrIH at 11:30 timestamp, Martin Kleppmann mentioned "Total Order Broadcast" algorithm and also mentioned "hold back/delayed delivery" similar to what Christophe answer suggested.
Now, my doubt is does message broker(RabbitMQ) take care of this? Or developer has to handle at application level?...i am guessing Message Broker should handle these things. If its true, then do we need to configure something to make it work?