{
List<Long> tags = consumer.drainReceiverQueueAndRetrieveDeliveryTags();
getPrefetchedMessageTags().addAll(tags);
}
RangeSet delivered = gatherRangeSet(getUnacknowledgedMessageTags());
RangeSet prefetched = gatherRangeSet(getPrefetchedMessageTags());
RangeSet all = RangeSetFactory.createRangeSet(delivered.size()
+ prefetched.size());
for (Iterator<Range> deliveredIter = delivered.iterator(); deliveredIter.hasNext();)
{
Range range = deliveredIter.next();
all.add(range);
}
for (Iterator<Range> prefetchedIter = prefetched.iterator(); prefetchedIter.hasNext();)
{
Range range = prefetchedIter.next();
all.add(range);
}
flushProcessed(all, false);
getQpidSession().messageRelease(delivered,Option.SET_REDELIVERED);
getQpidSession().messageRelease(prefetched);