@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 protected boolean matchesForwardingFilter(Message message, final MessageEvaluationContext mec) { boolean match = true; if (mec.getDestination().isQueue() && contains(message.getBrokerPath(), networkBrokerId)) { // potential replay back to origin match = allowReplayWhenNoConsumers && hasNoLocalConsumers(message, mec) && hasNotJustArrived(message); if (match) { LOG.trace("Replaying [{}] for [{}] back to origin in the absence of a local consumer", message.getMessageId(), message.getDestination()); } else { LOG.trace("Suppressing replay of [{}] for [{}] back to origin {}", new Object[]{ message.getMessageId(), message.getDestination(), Arrays.asList(message.getBrokerPath())} ); } } else { // use existing filter logic for topics and non replays match = super.matchesForwardingFilter(message, mec); } if (match && rateLimitExceeded()) { LOG.trace("Throttled network consumer rejecting [{}] for [{}] {}>{}/{}", new Object[]{ message.getMessageId(), message.getDestination(), matchCount, rateLimit, rateDuration }); match = false; } return match; }
@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); } };
@Override protected boolean matchesForwardingFilter(Message message, final MessageEvaluationContext mec) { boolean match = true; if (mec.getDestination().isQueue() && contains(message.getBrokerPath(), networkBrokerId)) { // potential replay back to origin match = allowReplayWhenNoConsumers && hasNoLocalConsumers(message, mec) && hasNotJustArrived(message); if (match) { LOG.trace("Replaying [{}] for [{}] back to origin in the absence of a local consumer", message.getMessageId(), message.getDestination()); } else { LOG.trace("Suppressing replay of [{}] for [{}] back to origin {}", new Object[]{ message.getMessageId(), message.getDestination(), Arrays.asList(message.getBrokerPath())} ); } } else { // use existing filter logic for topics and non replays match = super.matchesForwardingFilter(message, mec); } if (match && rateLimitExceeded()) { LOG.trace("Throttled network consumer rejecting [{}] for [{}] {}>{}/{}", new Object[]{ message.getMessageId(), message.getDestination(), matchCount, rateLimit, rateDuration }); match = false; } return match; }
@Override protected boolean matchesForwardingFilter(Message message, final MessageEvaluationContext mec) { boolean match = true; if (mec.getDestination().isQueue() && contains(message.getBrokerPath(), networkBrokerId)) { // potential replay back to origin match = allowReplayWhenNoConsumers && hasNoLocalConsumers(message, mec) && hasNotJustArrived(message); if (match) { LOG.trace("Replaying [{}] for [{}] back to origin in the absence of a local consumer", message.getMessageId(), message.getDestination()); } else { LOG.trace("Suppressing replay of [{}] for [{}] back to origin {}", new Object[]{ message.getMessageId(), message.getDestination(), Arrays.asList(message.getBrokerPath())} ); } } else { // use existing filter logic for topics and non replays match = super.matchesForwardingFilter(message, mec); } if (match && rateLimitExceeded()) { LOG.trace("Throttled network consumer rejecting [{}] for [{}] {}>{}/{}", new Object[]{ message.getMessageId(), message.getDestination(), matchCount, rateLimit, rateDuration }); match = false; } return match; }
@Override protected boolean matchesForwardingFilter(Message message, final MessageEvaluationContext mec) { boolean match = true; if (mec.getDestination().isQueue() && contains(message.getBrokerPath(), networkBrokerId)) { // potential replay back to origin match = allowReplayWhenNoConsumers && hasNoLocalConsumers(message, mec) && hasNotJustArrived(message); if (match) { LOG.trace("Replaying [{}] for [{}] back to origin in the absence of a local consumer", message.getMessageId(), message.getDestination()); } else { LOG.trace("Suppressing replay of [{}] for [{}] back to origin {}", new Object[]{ message.getMessageId(), message.getDestination(), Arrays.asList(message.getBrokerPath())} ); } } else { // use existing filter logic for topics and non replays match = super.matchesForwardingFilter(message, mec); } if (match && rateLimitExceeded()) { LOG.trace("Throttled network consumer rejecting [{}] for [{}] {}>{}/{}", new Object[]{ message.getMessageId(), message.getDestination(), matchCount, rateLimit, rateDuration }); match = false; } return match; }