We have a very simple application which read messages from MQ and transform the messages into some different format and send it to another MQ. The application is deployed in the Openshift environment. Hence at any given time multiple instances of the same application will be running. We are not using any DB in our application.
We want to maintain the order of messages. Basically while reading the messages, they were present in source MQ with some order(for e.g. A1-A2-A3-A4-A5) then post transformation they should be in same order in out MQ.
Eg.: Let's suppose event A1 has happened then A2 and then A3 and then A4 and then A5. Events A1 and A3 are interlinked means has some relation. Multiple instances of same application are listening on dedicated Queue for these events. Let's suppose there were 5 instances of applications running, then there can be a case where instance which has picked A3 event has finished processing. While A1 event processing still not completed. So basically I want to ensure A3 processed output should not be sent to out Queue until its previous event A1 is completed successfully and sent to out queue.
Can someone please help me with this problem?