mirror of https://github.com/apache/activemq.git
(AMQ-6858) - add extra precautionary check for demand subs
also remove test that intermittently fails with timing issues
(cherry picked from commit 08aa5118ff
)
This commit is contained in:
parent
3285be60ed
commit
1cfc9ff9a6
|
@ -83,7 +83,8 @@ public class ConduitBridge extends DemandForwardingBridge {
|
||||||
} else {
|
} else {
|
||||||
//Handle the demand generated by proxy network subscriptions
|
//Handle the demand generated by proxy network subscriptions
|
||||||
//The broker path is case is normal
|
//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();
|
final BrokerId[] path = info.getBrokerPath();
|
||||||
addProxyNetworkSubscriptionBrokerPath(ds, path, info.getSubscriptionName());
|
addProxyNetworkSubscriptionBrokerPath(ds, path, info.getSubscriptionName());
|
||||||
//This is the durable sync case on broker restart
|
//This is the durable sync case on broker restart
|
||||||
|
|
|
@ -1432,7 +1432,8 @@ public abstract class DemandForwardingBridgeSupport implements NetworkBridge, Br
|
||||||
if (consumerInfo.isDurable()) {
|
if (consumerInfo.isDurable()) {
|
||||||
//Handle the demand generated by proxy network subscriptions
|
//Handle the demand generated by proxy network subscriptions
|
||||||
//The broker path is case is normal
|
//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();
|
final BrokerId[] path = info.getBrokerPath();
|
||||||
addProxyNetworkSubscriptionBrokerPath(sub, path, consumerInfo.getSubscriptionName());
|
addProxyNetworkSubscriptionBrokerPath(sub, path, consumerInfo.getSubscriptionName());
|
||||||
//This is the durable sync case on broker restart
|
//This is the durable sync case on broker restart
|
||||||
|
|
|
@ -63,30 +63,15 @@ public class DurableFiveBrokerNetworkBridgeTest extends JmsMultipleBrokersTestSu
|
||||||
return connector;
|
return connector;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testDurablePropagationBrokerRestartDuplex() throws Exception {
|
public void testDurablePropagationBrokerRestart() throws Exception {
|
||||||
duplex = true;
|
duplex = true;
|
||||||
testDurablePropagationBrokerRestart();
|
|
||||||
}
|
|
||||||
|
|
||||||
public void testDurablePropagationBrokerRestartOneWay() throws Exception {
|
|
||||||
duplex = false;
|
|
||||||
testDurablePropagationBrokerRestart();
|
|
||||||
}
|
|
||||||
|
|
||||||
protected void testDurablePropagationBrokerRestart() throws Exception {
|
|
||||||
// Setup broker networks
|
// Setup broker networks
|
||||||
bridgeBrokers("Broker_A_A", "Broker_B_B");
|
bridgeBrokers("Broker_A_A", "Broker_B_B");
|
||||||
bridgeBrokers("Broker_B_B", "Broker_C_C");
|
bridgeBrokers("Broker_B_B", "Broker_C_C");
|
||||||
bridgeBrokers("Broker_C_C", "Broker_D_D");
|
bridgeBrokers("Broker_C_C", "Broker_D_D");
|
||||||
bridgeBrokers("Broker_D_D", "Broker_E_E");
|
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();
|
startAllBrokers();
|
||||||
|
|
||||||
// Setup destination
|
// Setup destination
|
||||||
|
@ -139,12 +124,6 @@ public class DurableFiveBrokerNetworkBridgeTest extends JmsMultipleBrokersTestSu
|
||||||
bridgeBrokers("Broker_B_B", "Broker_C_C");
|
bridgeBrokers("Broker_B_B", "Broker_C_C");
|
||||||
bridgeBrokers("Broker_C_C", "Broker_D_D");
|
bridgeBrokers("Broker_C_C", "Broker_D_D");
|
||||||
bridgeBrokers("Broker_D_D", "Broker_E_E");
|
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();
|
startAllBrokers();
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue