activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rajdav...@apache.org
Subject svn commit: r581881 - /activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/region/Topic.java
Date Thu, 04 Oct 2007 12:48:03 GMT
Author: rajdavies
Date: Thu Oct  4 05:48:02 2007
New Revision: 581881

URL: http://svn.apache.org/viewvc?rev=581881&view=rev
Log:
By default, use no subscription recovery policy for temporary or advisory topics

Modified:
    activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/region/Topic.java

Modified: activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/region/Topic.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/region/Topic.java?rev=581881&r1=581880&r2=581881&view=diff
==============================================================================
--- activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/region/Topic.java
(original)
+++ activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/region/Topic.java
Thu Oct  4 05:48:02 2007
@@ -31,6 +31,7 @@
 import org.apache.activemq.broker.region.policy.DeadLetterStrategy;
 import org.apache.activemq.broker.region.policy.DispatchPolicy;
 import org.apache.activemq.broker.region.policy.FixedSizedSubscriptionRecoveryPolicy;
+import org.apache.activemq.broker.region.policy.NoSubscriptionRecoveryPolicy;
 import org.apache.activemq.broker.region.policy.SharedDeadLetterStrategy;
 import org.apache.activemq.broker.region.policy.SimpleDispatchPolicy;
 import org.apache.activemq.broker.region.policy.SubscriptionRecoveryPolicy;
@@ -73,7 +74,7 @@
     protected final DestinationStatistics destinationStatistics = new DestinationStatistics();
 
     private DispatchPolicy dispatchPolicy = new SimpleDispatchPolicy();
-    private SubscriptionRecoveryPolicy subscriptionRecoveryPolicy = new FixedSizedSubscriptionRecoveryPolicy();
+    private SubscriptionRecoveryPolicy subscriptionRecoveryPolicy;
     private boolean sendAdvisoryIfNoConsumers;
     private DeadLetterStrategy deadLetterStrategy = new SharedDeadLetterStrategy();
     private final ConcurrentHashMap<SubscriptionKey, DurableTopicSubscription> durableSubcribers
= new ConcurrentHashMap<SubscriptionKey, DurableTopicSubscription>();
@@ -105,7 +106,13 @@
         this.systemUsage=systemUsage;
         this.memoryUsage = new MemoryUsage(systemUsage.getMemoryUsage(), destination.toString());
         this.memoryUsage.setUsagePortion(1.0f);
-
+        //set default subscription recovery policy
+        if (destination.isTemporary() || AdvisorySupport.isAdvisoryTopic(destination) ){
+        	 subscriptionRecoveryPolicy= new NoSubscriptionRecoveryPolicy();
+        }else{
+        	//set the default
+        	subscriptionRecoveryPolicy= new FixedSizedSubscriptionRecoveryPolicy();
+        }
         // Let the store know what usage manager we are using so that he can
         // flush messages to disk
         // when usage gets high.



Mime
View raw message