From 90fcbc8812a760f59e502dd5bd4ec05a01a35ab6 Mon Sep 17 00:00:00 2001 From: Gary Tully Date: Fri, 13 Apr 2012 12:24:58 +0000 Subject: [PATCH] https://issues.apache.org/jira/browse/AMQ-3630 - NetworkBridgeFilterFactory should be assigned to Queue not NetworkBridge - thanks. the filter should be evaluated per destination git-svn-id: https://svn.apache.org/repos/asf/activemq/trunk@1325735 13f79535-47bb-0310-9956-ffa450edef68 --- .../network/DemandForwardingBridgeSupport.java | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/activemq-core/src/main/java/org/apache/activemq/network/DemandForwardingBridgeSupport.java b/activemq-core/src/main/java/org/apache/activemq/network/DemandForwardingBridgeSupport.java index bb6a4d1ee8..72316ce392 100644 --- a/activemq-core/src/main/java/org/apache/activemq/network/DemandForwardingBridgeSupport.java +++ b/activemq-core/src/main/java/org/apache/activemq/network/DemandForwardingBridgeSupport.java @@ -121,7 +121,7 @@ public abstract class DemandForwardingBridgeSupport implements NetworkBridge, Br protected CountDownLatch localStartedLatch = new CountDownLatch(1); protected final AtomicBoolean lastConnectSucceeded = new AtomicBoolean(false); protected NetworkBridgeConfiguration configuration; - protected NetworkBridgeFilterFactory filterFactory; + protected final NetworkBridgeFilterFactory defaultFilterFactory = new DefaultNetworkBridgeFilterFactory(); protected final BrokerId remoteBrokerPath[] = new BrokerId[] {null}; protected Object brokerInfoMutex = new Object(); @@ -1188,18 +1188,14 @@ public abstract class DemandForwardingBridgeSupport implements NetworkBridge, Br } protected NetworkBridgeFilter createNetworkBridgeFilter(ConsumerInfo info) throws IOException { - if (filterFactory == null) { - if (brokerService != null && brokerService.getDestinationPolicy() != null) { - PolicyEntry entry = brokerService.getDestinationPolicy().getEntryFor(info.getDestination()); - if (entry != null) { - filterFactory = entry.getNetworkBridgeFilterFactory(); - } - } - if (filterFactory == null) { - filterFactory = new DefaultNetworkBridgeFilterFactory(); + NetworkBridgeFilterFactory filterFactory = defaultFilterFactory; + if (brokerService != null && brokerService.getDestinationPolicy() != null) { + PolicyEntry entry = brokerService.getDestinationPolicy().getEntryFor(info.getDestination()); + if (entry != null && entry.getNetworkBridgeFilterFactory() != null) { + filterFactory = entry.getNetworkBridgeFilterFactory(); } } - return filterFactory.create(info, getRemoteBrokerPath(), configuration.getNetworkTTL() ); + return filterFactory.create(info, getRemoteBrokerPath(), configuration.getNetworkTTL()); } protected void serviceLocalBrokerInfo(Command command) throws InterruptedException {