I have a problem where I need to synchronize processing for multiple threads on several different servers for a Java service on Windows.
In this application, I have several consumer thread streams that go out of the same JMS queue. Messages are in groups of 3 or 4, and I need to make sure that the messages in each group are processed completely in sequential order. I need some kind of synchronization mechanism to make sure thread1 pulled the message and then thread2 pulled the next message from this group, thread2 waits for thread1 to finish processing before starting to process this message.
Any suggestions on distributed thread synchronization mechanisms? Any type of solution would be good (JMS solutions, distributed caching, etc.)
Note. The JMS provider we use is ActiveMQ.
source
share