@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; }
@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 NetworkBridgeFilter create(ConsumerInfo info, BrokerId[] remoteBrokerPath, int messageTTL, int consumerTTL) { ConditionalNetworkBridgeFilter filter = new ConditionalNetworkBridgeFilter(); filter.setNetworkBrokerId(remoteBrokerPath[0]); filter.setMessageTTL(messageTTL); filter.setConsumerTTL(consumerTTL); filter.setAllowReplayWhenNoConsumers(isReplayWhenNoConsumers()); filter.setRateLimit(getRateLimit()); filter.setRateDuration(getRateDuration()); filter.setReplayDelay(getReplayDelay()); return filter; }
@Override public NetworkBridgeFilter create(ConsumerInfo info, BrokerId[] remoteBrokerPath, int messageTTL, int consumerTTL) { ConditionalNetworkBridgeFilter filter = new ConditionalNetworkBridgeFilter(); filter.setNetworkBrokerId(remoteBrokerPath[0]); filter.setMessageTTL(messageTTL); filter.setConsumerTTL(consumerTTL); filter.setAllowReplayWhenNoConsumers(isReplayWhenNoConsumers()); filter.setRateLimit(getRateLimit()); filter.setRateDuration(getRateDuration()); filter.setReplayDelay(getReplayDelay()); return filter; }
@Override public NetworkBridgeFilter create(ConsumerInfo info, BrokerId[] remoteBrokerPath, int messageTTL, int consumerTTL) { ConditionalNetworkBridgeFilter filter = new ConditionalNetworkBridgeFilter(); filter.setNetworkBrokerId(remoteBrokerPath[0]); filter.setMessageTTL(messageTTL); filter.setConsumerTTL(consumerTTL); filter.setAllowReplayWhenNoConsumers(isReplayWhenNoConsumers()); filter.setRateLimit(getRateLimit()); filter.setRateDuration(getRateDuration()); filter.setReplayDelay(getReplayDelay()); return filter; }
@Override public NetworkBridgeFilter create(ConsumerInfo info, BrokerId[] remoteBrokerPath, int messageTTL, int consumerTTL) { ConditionalNetworkBridgeFilter filter = new ConditionalNetworkBridgeFilter(); filter.setNetworkBrokerId(remoteBrokerPath[0]); filter.setMessageTTL(messageTTL); filter.setConsumerTTL(consumerTTL); filter.setAllowReplayWhenNoConsumers(isReplayWhenNoConsumers()); filter.setRateLimit(getRateLimit()); filter.setRateDuration(getRateDuration()); filter.setReplayDelay(getReplayDelay()); filter.setSelectorAware(isSelectorAware()); return filter; }