2 Replies Latest reply on Mar 8, 2010 11:16 PM by saltnlight5

    FilterMessageHandler resets after scanning queue

    timfox

      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?