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

also remove test that intermittently fails with timing issues
This commit is contained in:
Christopher L. Shannon (cshannon) 2017-11-16 07:44:33 -05:00
parent 2e3a7f6114
commit 08aa5118ff
3 changed files with 5 additions and 24 deletions

View File

@ -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

View File

@ -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

View File

@ -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();