diff --git a/activemq-broker/src/main/java/org/apache/activemq/network/ConduitBridge.java b/activemq-broker/src/main/java/org/apache/activemq/network/ConduitBridge.java index 70f45f751a..a4b5072a5c 100644 --- a/activemq-broker/src/main/java/org/apache/activemq/network/ConduitBridge.java +++ b/activemq-broker/src/main/java/org/apache/activemq/network/ConduitBridge.java @@ -83,7 +83,8 @@ public class ConduitBridge extends DemandForwardingBridge { } else { //Handle the demand generated by proxy network subscriptions //The broker path is case is normal - if (isProxyNSConsumerBrokerPath(info)) { + if (isProxyNSConsumerBrokerPath(info) && + info.getSubscriptionName() != null && info.getSubscriptionName().startsWith(DURABLE_SUB_PREFIX)) { final BrokerId[] path = info.getBrokerPath(); addProxyNetworkSubscriptionBrokerPath(ds, path, info.getSubscriptionName()); //This is the durable sync case on broker restart diff --git a/activemq-broker/src/main/java/org/apache/activemq/network/DemandForwardingBridgeSupport.java b/activemq-broker/src/main/java/org/apache/activemq/network/DemandForwardingBridgeSupport.java index df493c3c2b..dd7716f041 100644 --- a/activemq-broker/src/main/java/org/apache/activemq/network/DemandForwardingBridgeSupport.java +++ b/activemq-broker/src/main/java/org/apache/activemq/network/DemandForwardingBridgeSupport.java @@ -1432,7 +1432,8 @@ public abstract class DemandForwardingBridgeSupport implements NetworkBridge, Br if (consumerInfo.isDurable()) { //Handle the demand generated by proxy network subscriptions //The broker path is case is normal - if (isProxyNSConsumerBrokerPath(sub.getRemoteInfo())) { + if (isProxyNSConsumerBrokerPath(sub.getRemoteInfo()) && + info.getSubscriptionName() != null && info.getSubscriptionName().startsWith(DURABLE_SUB_PREFIX)) { final BrokerId[] path = info.getBrokerPath(); addProxyNetworkSubscriptionBrokerPath(sub, path, consumerInfo.getSubscriptionName()); //This is the durable sync case on broker restart diff --git a/activemq-unit-tests/src/test/java/org/apache/activemq/network/DurableFiveBrokerNetworkBridgeTest.java b/activemq-unit-tests/src/test/java/org/apache/activemq/network/DurableFiveBrokerNetworkBridgeTest.java index 5bbd8b8010..fe07ac3ee1 100644 --- a/activemq-unit-tests/src/test/java/org/apache/activemq/network/DurableFiveBrokerNetworkBridgeTest.java +++ b/activemq-unit-tests/src/test/java/org/apache/activemq/network/DurableFiveBrokerNetworkBridgeTest.java @@ -63,30 +63,15 @@ public class DurableFiveBrokerNetworkBridgeTest extends JmsMultipleBrokersTestSu return connector; } - public void testDurablePropagationBrokerRestartDuplex() throws Exception { + public void testDurablePropagationBrokerRestart() throws Exception { duplex = true; - testDurablePropagationBrokerRestart(); - } - public void testDurablePropagationBrokerRestartOneWay() throws Exception { - duplex = false; - testDurablePropagationBrokerRestart(); - } - - protected void testDurablePropagationBrokerRestart() throws Exception { // Setup broker networks bridgeBrokers("Broker_A_A", "Broker_B_B"); bridgeBrokers("Broker_B_B", "Broker_C_C"); bridgeBrokers("Broker_C_C", "Broker_D_D"); bridgeBrokers("Broker_D_D", "Broker_E_E"); - if (!duplex) { - bridgeBrokers("Broker_B_B", "Broker_A_A"); - bridgeBrokers("Broker_C_C", "Broker_B_B"); - bridgeBrokers("Broker_D_D", "Broker_C_C"); - bridgeBrokers("Broker_E_E", "Broker_D_D"); - } - startAllBrokers(); // Setup destination @@ -139,12 +124,6 @@ public class DurableFiveBrokerNetworkBridgeTest extends JmsMultipleBrokersTestSu bridgeBrokers("Broker_B_B", "Broker_C_C"); bridgeBrokers("Broker_C_C", "Broker_D_D"); bridgeBrokers("Broker_D_D", "Broker_E_E"); - if (!duplex) { - bridgeBrokers("Broker_B_B", "Broker_A_A"); - bridgeBrokers("Broker_C_C", "Broker_B_B"); - bridgeBrokers("Broker_D_D", "Broker_C_C"); - bridgeBrokers("Broker_E_E", "Broker_D_D"); - } startAllBrokers();