public boolean canDispatch(Subscription subscription, MessageReference node) throws Exception { MessageEvaluationContext msgContext = new NonCachedMessageEvaluationContext(); msgContext.setDestination(this.destination); msgContext.setMessageReference(node); return subscription.matches(node, msgContext); } }
@Override public boolean evaluate(ConnectionContext context, MessageReference r) throws JMSException { MessageEvaluationContext messageEvaluationContext = context.getMessageEvaluationContext(); messageEvaluationContext.setMessageReference(r); if (messageEvaluationContext.getDestination() == null) { messageEvaluationContext.setDestination(getActiveMQDestination()); } return selectorExpression.matches(messageEvaluationContext); } };
public ConnectionContext createConnectionContext() { ConnectionContext answer = new ConnectionContext(); answer.setBroker(this.broker); answer.getMessageEvaluationContext().setDestination(getActiveMQDestination()); answer.setSecurityContext(SecurityContext.BROKER_SECURITY_CONTEXT); return answer; }
messageContext.setMessageReference(message); messageContext.setDestination(filteredDestination.getDestination()); if (filteredDestination.matches(messageContext)) { destination = filteredDestination.getDestination();
try { MessageEvaluationContext msgContext = new NonCachedMessageEvaluationContext(); msgContext.setDestination(destination);
@Override public boolean addRecoveredMessage(ConnectionContext context, MessageReference message) throws Exception { boolean result = false; MessageEvaluationContext msgContext = context.getMessageEvaluationContext(); try { Destination regionDestination = (Destination) message.getRegionDestination(); msgContext.setDestination(regionDestination.getActiveMQDestination()); msgContext.setMessageReference(message); result = matches(message, msgContext); if (result) { doAddRecoveredMessage(message); } } finally { msgContext.clear(); } return result; }
msgContext.setDestination(destination); msgContext.setMessageReference(message); if (!dispatchPolicy.dispatch(message, msgContext, consumers)) {
/** * Respect the selectors of the subscriptions to ensure only matched messages are dispatched to * the virtual queues, hence there is no build up of unmatched messages on these destinations */ @Override protected boolean shouldDispatch(final Broker broker, Message message, Destination dest) throws IOException { //first validate that the prefix matches in the super class if (super.shouldDispatch(broker, message, dest)) { boolean matches = false; MessageEvaluationContext msgContext = new NonCachedMessageEvaluationContext(); msgContext.setDestination(dest.getActiveMQDestination()); msgContext.setMessageReference(message); List<Subscription> subs = dest.getConsumers(); for (Subscription sub : subs) { if (sub.matches(message, msgContext)) { matches = true; break; } } if (matches == false) { matches = tryMatchingCachedSubs(broker, dest, msgContext); } return matches; } return false; }
msgContext.setDestination(destination); if (subscription.isRecoveryRequired()) { topicStore.recoverSubscription(clientId, subscriptionName, new MessageRecoveryListener() {
public boolean canDispatch(Subscription subscription, MessageReference node) throws Exception { MessageEvaluationContext msgContext = new NonCachedMessageEvaluationContext(); msgContext.setDestination(this.destination); msgContext.setMessageReference(node); return subscription.matches(node, msgContext); } }
public boolean canDispatch(Subscription subscription, MessageReference node) throws Exception { MessageEvaluationContext msgContext = new NonCachedMessageEvaluationContext(); msgContext.setDestination(this.destination); msgContext.setMessageReference(node); return subscription.matches(node, msgContext); } }
public boolean canDispatch(Subscription subscription, MessageReference node) throws Exception { MessageEvaluationContext msgContext = new NonCachedMessageEvaluationContext(); msgContext.setDestination(this.destination); msgContext.setMessageReference(node); return subscription.matches(node, msgContext); } }
@Override public boolean evaluate(ConnectionContext context, MessageReference r) throws JMSException { MessageEvaluationContext messageEvaluationContext = context.getMessageEvaluationContext(); messageEvaluationContext.setMessageReference(r); if (messageEvaluationContext.getDestination() == null) { messageEvaluationContext.setDestination(getActiveMQDestination()); } return selectorExpression.matches(messageEvaluationContext); } };
@Override public boolean evaluate(ConnectionContext context, MessageReference r) throws JMSException { MessageEvaluationContext messageEvaluationContext = context.getMessageEvaluationContext(); messageEvaluationContext.setMessageReference(r); if (messageEvaluationContext.getDestination() == null) { messageEvaluationContext.setDestination(getActiveMQDestination()); } return selectorExpression.matches(messageEvaluationContext); } };
public boolean evaluate(ConnectionContext context, MessageReference r) throws JMSException { MessageEvaluationContext messageEvaluationContext = context.getMessageEvaluationContext(); messageEvaluationContext.setMessageReference(r); if (messageEvaluationContext.getDestination() == null) { messageEvaluationContext.setDestination(getActiveMQDestination()); } return selectorExpression.matches(messageEvaluationContext); } };
@Override public boolean evaluate(ConnectionContext context, MessageReference r) throws JMSException { MessageEvaluationContext messageEvaluationContext = context.getMessageEvaluationContext(); messageEvaluationContext.setMessageReference(r); if (messageEvaluationContext.getDestination() == null) { messageEvaluationContext.setDestination(getActiveMQDestination()); } return selectorExpression.matches(messageEvaluationContext); } };
public ConnectionContext createConnectionContext() { ConnectionContext answer = new ConnectionContext(); answer.setBroker(this.broker); answer.getMessageEvaluationContext().setDestination(getActiveMQDestination()); answer.setSecurityContext(SecurityContext.BROKER_SECURITY_CONTEXT); return answer; }
public ConnectionContext createConnectionContext() { ConnectionContext answer = new ConnectionContext(); answer.setBroker(this.broker); answer.getMessageEvaluationContext().setDestination(getActiveMQDestination()); answer.setSecurityContext(SecurityContext.BROKER_SECURITY_CONTEXT); return answer; }
public ConnectionContext createConnectionContext() { ConnectionContext answer = new ConnectionContext(); answer.setBroker(this.broker); answer.getMessageEvaluationContext().setDestination(getActiveMQDestination()); answer.setSecurityContext(SecurityContext.BROKER_SECURITY_CONTEXT); return answer; }
protected ConnectionContext createConnectionContext() { ConnectionContext answer = new ConnectionContext(new NonCachedMessageEvaluationContext()); answer.setBroker(this.broker); answer.getMessageEvaluationContext().setDestination(getActiveMQDestination()); answer.setSecurityContext(SecurityContext.BROKER_SECURITY_CONTEXT); return answer; }