This content has been marked as final. Show 2 replies
Looking at the code in FilterMessageHandler.peek, it resets the iterator after each scan:
if (consumer.getFilter() != null)
// we have iterated on the whole queue for
// messages which matches the consumer filter.
// we reset its iterator in case new messages are added to the queue
iterator = messageReferences.iterator();
This means effectively the whole queue is rescanned when a new message is added to a queue which has non matching messages.
I thought the whole reason of adding these handlers was to avoid rescanning?