/** * @param node * @param msgContext * @param consumers * @return true if dispatched * @throws Exception * @see org.apache.activemq.broker.region.policy.DispatchPolicy#dispatch(org.apache.activemq.broker.region.MessageReference, * org.apache.activemq.filter.MessageEvaluationContext, java.util.List) */ public boolean dispatch(MessageReference node, MessageEvaluationContext msgContext, List consumers) throws Exception { // Big synch here so that only 1 message gets dispatched at a time. // Ensures // Everyone sees the same order. synchronized (consumers) { int count = 0; for (Iterator iter = consumers.iterator(); iter.hasNext();) { Subscription sub = (Subscription)iter.next(); // Only dispatch to interested subscriptions if (!sub.matches(node, msgContext)) { sub.unmatched(node); continue; } sub.add(node); count++; } return count > 0; } }
sub.add(node); count++;
@Override public void processDispatchNotification(MessageDispatchNotification messageDispatchNotification) throws Exception { // do dispatch Subscription sub = getMatchingSubscription(messageDispatchNotification); if (sub != null) { MessageReference message = getMatchingMessage(messageDispatchNotification); sub.add(message); sub.processMessageDispatchNotification(messageDispatchNotification); } }
if (dispatchSelector.canSelect(s, node) && assignMessageGroup(s, (QueueMessageReference)node) && !((QueueMessageReference) node).isAcked() ) { s.add(node); LOG.trace("assigned {} to consumer {}", node.getMessageId(), s.getConsumerInfo().getConsumerId()); iterator.remove();
public boolean dispatch(MessageReference node, MessageEvaluationContext msgContext, List<Subscription> consumers) throws Exception { int count = 0; for (Subscription sub : consumers) { // Don't deliver to browsers if (sub.getConsumerInfo().isBrowser()) { continue; } // Only dispatch to interested subscriptions if (!sub.matches(node, msgContext)) { sub.unmatched(node); continue; } sub.add(node); count++; } return count > 0; }
synchronized (consumers) { if (!consumers.contains(sub)){ sub.add(context, this); consumers.add(sub); applyRecovery=true; synchronized (consumers) { if (!consumers.contains(sub)){ sub.add(context, this); consumers.add(sub); super.addSubscription(context, sub); DurableTopicSubscription dsub = (DurableTopicSubscription) sub; super.addSubscription(context, sub); sub.add(context, this); if(dsub.isActive()) { synchronized (consumers) {
try { sub.add(context, this);
/** * @param node * @param msgContext * @param consumers * @return true if dispatched * @throws Exception * @see org.apache.activemq.broker.region.policy.DispatchPolicy#dispatch(org.apache.activemq.broker.region.MessageReference, * org.apache.activemq.filter.MessageEvaluationContext, java.util.List) */ public boolean dispatch(MessageReference node, MessageEvaluationContext msgContext, List consumers) throws Exception { // Big synch here so that only 1 message gets dispatched at a time. // Ensures // Everyone sees the same order. synchronized (consumers) { int count = 0; for (Iterator iter = consumers.iterator(); iter.hasNext();) { Subscription sub = (Subscription)iter.next(); // Only dispatch to interested subscriptions if (!sub.matches(node, msgContext)) { sub.unmatched(node); continue; } sub.add(node); count++; } return count > 0; } }
/** * @param node * @param msgContext * @param consumers * @return true if dispatched * @throws Exception * @see org.apache.activemq.broker.region.policy.DispatchPolicy#dispatch(org.apache.activemq.broker.region.MessageReference, * org.apache.activemq.filter.MessageEvaluationContext, java.util.List) */ public boolean dispatch(MessageReference node, MessageEvaluationContext msgContext, List consumers) throws Exception { // Big synch here so that only 1 message gets dispatched at a time. // Ensures // Everyone sees the same order. synchronized (consumers) { int count = 0; for (Iterator iter = consumers.iterator(); iter.hasNext();) { Subscription sub = (Subscription)iter.next(); // Only dispatch to interested subscriptions if (!sub.matches(node, msgContext)) { sub.unmatched(node); continue; } sub.add(node); count++; } return count > 0; } }
/** * @param node * @param msgContext * @param consumers * @return true if dispatched * @throws Exception * @see org.apache.activemq.broker.region.policy.DispatchPolicy#dispatch(org.apache.activemq.broker.region.MessageReference, * org.apache.activemq.filter.MessageEvaluationContext, java.util.List) */ public boolean dispatch(MessageReference node, MessageEvaluationContext msgContext, List consumers) throws Exception { // Big synch here so that only 1 message gets dispatched at a time. // Ensures // Everyone sees the same order. synchronized (consumers) { int count = 0; for (Iterator iter = consumers.iterator(); iter.hasNext();) { Subscription sub = (Subscription)iter.next(); // Only dispatch to interested subscriptions if (!sub.matches(node, msgContext)) { sub.unmatched(node); continue; } sub.add(node); count++; } return count > 0; } }
/** * @param node * @param msgContext * @param consumers * @return true if dispatched * @throws Exception * @see org.apache.activemq.broker.region.policy.DispatchPolicy#dispatch(org.apache.activemq.broker.region.MessageReference, * org.apache.activemq.filter.MessageEvaluationContext, java.util.List) */ public boolean dispatch(MessageReference node, MessageEvaluationContext msgContext, List consumers) throws Exception { // Big synch here so that only 1 message gets dispatched at a time. // Ensures // Everyone sees the same order. synchronized (consumers) { int count = 0; for (Iterator iter = consumers.iterator(); iter.hasNext();) { Subscription sub = (Subscription)iter.next(); // Only dispatch to interested subscriptions if (!sub.matches(node, msgContext)) { sub.unmatched(node); continue; } sub.add(node); count++; } return count > 0; } }
@Override public void processDispatchNotification(MessageDispatchNotification messageDispatchNotification) throws Exception { // do dispatch Subscription sub = getMatchingSubscription(messageDispatchNotification); if (sub != null) { MessageReference message = getMatchingMessage(messageDispatchNotification); sub.add(message); sub.processMessageDispatchNotification(messageDispatchNotification); } }
@Override public void processDispatchNotification(MessageDispatchNotification messageDispatchNotification) throws Exception { // do dispatch Subscription sub = getMatchingSubscription(messageDispatchNotification); if (sub != null) { MessageReference message = getMatchingMessage(messageDispatchNotification); sub.add(message); sub.processMessageDispatchNotification(messageDispatchNotification); } }
@Override public void processDispatchNotification(MessageDispatchNotification messageDispatchNotification) throws Exception { // do dispatch Subscription sub = getMatchingSubscription(messageDispatchNotification); if (sub != null) { MessageReference message = getMatchingMessage(messageDispatchNotification); sub.add(message); sub.processMessageDispatchNotification(messageDispatchNotification); } }
@Override public void processDispatchNotification(MessageDispatchNotification messageDispatchNotification) throws Exception { // do dispatch Subscription sub = getMatchingSubscription(messageDispatchNotification); if (sub != null) { MessageReference message = getMatchingMessage(messageDispatchNotification); sub.add(message); sub.processMessageDispatchNotification(messageDispatchNotification); } }
public boolean dispatch(MessageReference node, MessageEvaluationContext msgContext, List<Subscription> consumers) throws Exception { int count = 0; for (Subscription sub : consumers) { // Don't deliver to browsers if (sub.getConsumerInfo().isBrowser()) { continue; } // Only dispatch to interested subscriptions if (!sub.matches(node, msgContext)) { sub.unmatched(node); continue; } sub.add(node); count++; } return count > 0; }
public boolean dispatch(MessageReference node, MessageEvaluationContext msgContext, List<Subscription> consumers) throws Exception { int count = 0; for (Subscription sub : consumers) { // Don't deliver to browsers if (sub.getConsumerInfo().isBrowser()) { continue; } // Only dispatch to interested subscriptions if (!sub.matches(node, msgContext)) { sub.unmatched(node); continue; } sub.add(node); count++; } return count > 0; }
public boolean dispatch(MessageReference node, MessageEvaluationContext msgContext, List<Subscription> consumers) throws Exception { int count = 0; for (Subscription sub : consumers) { // Don't deliver to browsers if (sub.getConsumerInfo().isBrowser()) { continue; } // Only dispatch to interested subscriptions if (!sub.matches(node, msgContext)) { sub.unmatched(node); continue; } sub.add(node); count++; } return count > 0; }
public boolean dispatch(MessageReference node, MessageEvaluationContext msgContext, List<Subscription> consumers) throws Exception { int count = 0; for (Subscription sub : consumers) { // Don't deliver to browsers if (sub.getConsumerInfo().isBrowser()) { continue; } // Only dispatch to interested subscriptions if (!sub.matches(node, msgContext)) { sub.unmatched(node); continue; } sub.add(node); count++; } return count > 0; }