activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cshan...@apache.org
Subject activemq git commit: (AMQ-6858) - add extra precautionary check for demand subs
Date Thu, 16 Nov 2017 12:46:27 GMT
Repository: activemq
Updated Branches:
  refs/heads/master 2e3a7f611 -> 08aa5118f


(AMQ-6858) - add extra precautionary check for demand subs

also remove test that intermittently fails with timing issues


Project: http://git-wip-us.apache.org/repos/asf/activemq/repo
Commit: http://git-wip-us.apache.org/repos/asf/activemq/commit/08aa5118
Tree: http://git-wip-us.apache.org/repos/asf/activemq/tree/08aa5118
Diff: http://git-wip-us.apache.org/repos/asf/activemq/diff/08aa5118

Branch: refs/heads/master
Commit: 08aa5118ffcd8dfc4ec813d799a61ef1ee4421d1
Parents: 2e3a7f6
Author: Christopher L. Shannon (cshannon) <christopher.l.shannon@gmail.com>
Authored: Thu Nov 16 07:44:33 2017 -0500
Committer: Christopher L. Shannon (cshannon) <christopher.l.shannon@gmail.com>
Committed: Thu Nov 16 07:44:33 2017 -0500

----------------------------------------------------------------------
 .../apache/activemq/network/ConduitBridge.java  |  3 ++-
 .../network/DemandForwardingBridgeSupport.java  |  3 ++-
 .../DurableFiveBrokerNetworkBridgeTest.java     | 23 +-------------------
 3 files changed, 5 insertions(+), 24 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/activemq/blob/08aa5118/activemq-broker/src/main/java/org/apache/activemq/network/ConduitBridge.java
----------------------------------------------------------------------
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 70f45f7..a4b5072 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

http://git-wip-us.apache.org/repos/asf/activemq/blob/08aa5118/activemq-broker/src/main/java/org/apache/activemq/network/DemandForwardingBridgeSupport.java
----------------------------------------------------------------------
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 df493c3..dd7716f 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

http://git-wip-us.apache.org/repos/asf/activemq/blob/08aa5118/activemq-unit-tests/src/test/java/org/apache/activemq/network/DurableFiveBrokerNetworkBridgeTest.java
----------------------------------------------------------------------
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 5bbd8b8..fe07ac3 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();
 


Mime
View raw message