Iterator<BrowserDispatch> browsers = browserDispatches.iterator();
while (browsers.hasNext()) {
BrowserDispatch browserDispatch = browsers.next();
try {
MessageEvaluationContext msgContext = new NonCachedMessageEvaluationContext();
msgContext.setDestination(destination);
QueueBrowserSubscription browser = browserDispatch.getBrowser();
if (LOG.isDebugEnabled()) {
LOG.debug("dispatch to browser: " + browser
+ ", already dispatched/paged count: " + alreadyDispatchedMessages.size());
}
boolean added = false;
for (QueueMessageReference node : alreadyDispatchedMessages) {
if (!node.isAcked() && !browser.getPending().getMessageAudit().isDuplicate(node.getMessageId())) {
msgContext.setMessageReference(node);
if (browser.matches(node, msgContext)) {
browser.add(node);
added = true;
}
}