I am using ActiveMQ to store messages to be used later. It is working as expected, but there is a specific scenario I need to fit which I cannot figure out. The short question is this.
Is there a way to run a query on the queue to find out all messages with certain header values?
The problem in detail is this :
So there is a set of data that is coming in multiple messages and the requirement is to use that data only after all messages for that has come in. So if the dataset has lets say 50 messages i need to wait for those 50 messages and then read them in. I am adding headers to each message to denote they belong to a certain set. Like "TotalSets"=50 , "SetId"=39 . I would like to write a thread that keeps tracing if all sets for a particular batch has arrived.