Due to memory constraint, activeMQ only returns a snapshot of the queue and does not guarantee all the messages while iterating over it.
In order to count all the messages, with one of it's property matching a specific value, I thought of making a copy of the queue (without consuming the messages). Once a temporary copy is made, I can start consuming the messages from this temporary queue and count all the messages matching the property. This way the original queue will remain unaffected.
Is it possible to make a copy of an queue without consuming messages from it? Are there any drawback of it?
Mirrored queues, Virtual Topics and Composite Destinations would not be helpful as it would forward all the messages to another queue and not make copy of an existing queue.