Let's say I have
Service A
that publishesMessage 1
to be processed byConsumer A
- The same
service A
that publishesMessage 2
to be processed byConsumer B
I need to make sure that consumer B
processes Message 2
only after Message 1
has been fully processed. What is the common or best approach to this kind of situation ?
I was thinking that maybe I would need to generate a unique identifier and pass it in both messages and store it in the database so that Consumer A
can update the status of the process and Consumer B
can look up the status and only starts processing Message 2
after Consumer A
has finished, otherwise it would push the message back into the queue. Would that be feasible ?
Consumer A
can notify backService A
once processed and thenService A
can send toConsumer B
?service A
to just push the message to the queue and immediately return a response without waiting for anything