if (del != null && del.isSelectorAccepted())
{
routed = true;
Queue queue = (Queue)del.getObserver();
if (queue.isClustered())
{
ClusteredQueue cq = (ClusteredQueue)queue;
if (trace) { log.trace(this + " successfully routed message to " + (cq.isLocal() ? "LOCAL" : "REMOTE") + " destination '" + cq.getName() + "' on node " + cq.getNodeId()); }
if (router.getNumberOfReceivers() > 1)
{
// We have now chosen which one will receive the message so we need to add this
// information to a map which will get sent when casting - so the the queue on
// the receiving node knows whether to receive the message.
if (queueNameNodeIdMap == null)
{
queueNameNodeIdMap = new HashMap();
}
queueNameNodeIdMap.put(queue.getName(), new Integer(cq.getNodeId()));
}
if (!cq.isLocal())
{
// We need to send the message remotely, count recipients so we know whether
// to unicast or multicast
numberRemote++;
lastNodeId = cq.getNodeId();
lastChannelId = queue.getChannelID();
}
}
else
{
if (trace) { log.trace(this + " successfully routed message to non clustered destination '" + queue.getName()); }
}
}
}
// Now we've sent the message to any local queues, we might also need to send the