I am working with Spring Batch job, I have a job which scheduled every minute and gets the latest transaction from the database, for the load balancing job scheduled on multiple machines for example. If Machine1 executing the job then the same job scheduled on the Machine2, I handled the unique transaction by Time, I stored the Min-Max time in the database while reading, So when the job gets scheduled on other it took the min-max time and execute the job based on time.
But I have one issue in this, Actually, I want to maintain the sequence of transaction based on customer Id, For example, if Machine1 Execute the transaction 1 to 100 and Machine2 will execute transaction 101 to 200 and the transaction 100 and 101 did by the same customer than transaction should be processed on the same sequence.
In My Case, Machine1 did not finish the task and at the same time Machine2 started its process, So the problem here is that the 101st transactions processed before 100th.
Check the execution flow in the below Image.