https://issues.apache.org/jira/browse/AMQ-2665 - regression, keepDurableSubsActive is not properly propagated to the durable subscription leading to increasing consumer list

git-svn-id: https://svn.apache.org/repos/asf/activemq/trunk@1360085 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Bosanac Dejan 2012-07-11 09:28:19 +00:00
parent 425fa47360
commit e66967bff1
2 changed files with 8 additions and 2 deletions

View File

@ -181,7 +181,6 @@ public class RegionBroker extends EmptyBroker {
@Override @Override
public void start() throws Exception { public void start() throws Exception {
((TopicRegion)topicRegion).setKeepDurableSubsActive(keepDurableSubsActive);
started = true; started = true;
queueRegion.start(); queueRegion.start();
topicRegion.start(); topicRegion.start();
@ -722,6 +721,7 @@ public class RegionBroker extends EmptyBroker {
public void setKeepDurableSubsActive(boolean keepDurableSubsActive) { public void setKeepDurableSubsActive(boolean keepDurableSubsActive) {
this.keepDurableSubsActive = keepDurableSubsActive; this.keepDurableSubsActive = keepDurableSubsActive;
((TopicRegion)topicRegion).setKeepDurableSubsActive(keepDurableSubsActive);
} }
public DestinationInterceptor getDestinationInterceptor() { public DestinationInterceptor getDestinationInterceptor() {

View File

@ -76,6 +76,7 @@ public class DurableSubscriptionActivationTest extends org.apache.activemq.TestS
broker.setDestinations(new ActiveMQDestination[]{topic}); broker.setDestinations(new ActiveMQDestination[]{topic});
broker.start(); broker.start();
broker.waitUntilStarted();
connection = createConnection(); connection = createConnection();
} }
@ -83,8 +84,10 @@ public class DurableSubscriptionActivationTest extends org.apache.activemq.TestS
private void destroyBroker() throws Exception { private void destroyBroker() throws Exception {
if (connection != null) if (connection != null)
connection.close(); connection.close();
if (broker != null) if (broker != null) {
broker.stop(); broker.stop();
broker.waitUntilStopped();
}
} }
public void testActivateWithExistingTopic1() throws Exception { public void testActivateWithExistingTopic1() throws Exception {
@ -121,6 +124,8 @@ public class DurableSubscriptionActivationTest extends org.apache.activemq.TestS
// restart the broker // restart the broker
restartBroker(); restartBroker();
Destination d1 = broker.getDestination(topic);
// activate // activate
session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE); session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
session.createDurableSubscriber(topic, "SubsId"); session.createDurableSubscriber(topic, "SubsId");
@ -136,4 +141,5 @@ public class DurableSubscriptionActivationTest extends org.apache.activemq.TestS
assertTrue("More than one consumer found: " + d.getConsumers().size(), d.getConsumers().size() == 1); assertTrue("More than one consumer found: " + d.getConsumers().size(), d.getConsumers().size() == 1);
} }
} }