activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dej...@apache.org
Subject svn commit: r1360085 - in /activemq/trunk/activemq-core/src: main/java/org/apache/activemq/broker/region/RegionBroker.java test/java/org/apache/activemq/usecases/DurableSubscriptionActivationTest.java
Date Wed, 11 Jul 2012 09:28:20 GMT
Author: dejanb
Date: Wed Jul 11 09:28:19 2012
New Revision: 1360085

URL: http://svn.apache.org/viewvc?rev=1360085&view=rev
Log:
https://issues.apache.org/jira/browse/AMQ-2665 - regression, keepDurableSubsActive is not
properly propagated to the durable subscription leading to increasing consumer list

Modified:
    activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/region/RegionBroker.java
    activemq/trunk/activemq-core/src/test/java/org/apache/activemq/usecases/DurableSubscriptionActivationTest.java

Modified: activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/region/RegionBroker.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/region/RegionBroker.java?rev=1360085&r1=1360084&r2=1360085&view=diff
==============================================================================
--- activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/region/RegionBroker.java
(original)
+++ activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/region/RegionBroker.java
Wed Jul 11 09:28:19 2012
@@ -181,7 +181,6 @@ public class RegionBroker extends EmptyB
 
     @Override
     public void start() throws Exception {
-        ((TopicRegion)topicRegion).setKeepDurableSubsActive(keepDurableSubsActive);
         started = true;
         queueRegion.start();
         topicRegion.start();
@@ -722,6 +721,7 @@ public class RegionBroker extends EmptyB
 
     public void setKeepDurableSubsActive(boolean keepDurableSubsActive) {
         this.keepDurableSubsActive = keepDurableSubsActive;
+        ((TopicRegion)topicRegion).setKeepDurableSubsActive(keepDurableSubsActive);
     }
 
     public DestinationInterceptor getDestinationInterceptor() {

Modified: activemq/trunk/activemq-core/src/test/java/org/apache/activemq/usecases/DurableSubscriptionActivationTest.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/usecases/DurableSubscriptionActivationTest.java?rev=1360085&r1=1360084&r2=1360085&view=diff
==============================================================================
--- activemq/trunk/activemq-core/src/test/java/org/apache/activemq/usecases/DurableSubscriptionActivationTest.java
(original)
+++ activemq/trunk/activemq-core/src/test/java/org/apache/activemq/usecases/DurableSubscriptionActivationTest.java
Wed Jul 11 09:28:19 2012
@@ -76,6 +76,7 @@ public class DurableSubscriptionActivati
         broker.setDestinations(new ActiveMQDestination[]{topic});
 
         broker.start();
+        broker.waitUntilStarted();
 
         connection = createConnection();
     }
@@ -83,8 +84,10 @@ public class DurableSubscriptionActivati
     private void destroyBroker() throws Exception {
         if (connection != null)
             connection.close();
-        if (broker != null)
+        if (broker != null) {
             broker.stop();
+            broker.waitUntilStopped();
+        }
     }
 
     public void testActivateWithExistingTopic1() throws Exception {
@@ -121,6 +124,8 @@ public class DurableSubscriptionActivati
         // restart the broker
         restartBroker();
 
+        Destination d1 = broker.getDestination(topic);
+
         // activate
         session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
         session.createDurableSubscriber(topic, "SubsId");
@@ -136,4 +141,5 @@ public class DurableSubscriptionActivati
 
         assertTrue("More than one consumer found: " + d.getConsumers().size(), d.getConsumers().size()
== 1);
     }
+
 }



Mime
View raw message