// Everyone sees the same order and that the consumer list is not used while
// it's being rotated.
synchronized(consumers) {
int count = 0;
Subscription firstMatchingConsumer = null;
for (Iterator iter = consumers.iterator(); iter.hasNext();) {
Subscription sub = (Subscription) iter.next();
// Only dispatch to interested subscriptions
if (!sub.matches(node, msgContext))
continue;
if (firstMatchingConsumer == null) {
firstMatchingConsumer = sub;
}
sub.add(node);
count++;
}
if (firstMatchingConsumer != null) {