activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rajdav...@apache.org
Subject svn commit: r692134 - /activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/region/Topic.java
Date Thu, 04 Sep 2008 16:04:28 GMT
Author: rajdavies
Date: Thu Sep  4 09:04:27 2008
New Revision: 692134

URL: http://svn.apache.org/viewvc?rev=692134&view=rev
Log:
Applied patch for https://issues.apache.org/activemq/browse/AMQ-1833

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=692134&r1=692133&r2=692134&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 Sep  4 09:04:27 2008
@@ -17,10 +17,10 @@
 package org.apache.activemq.broker.region;
 
 import java.io.IOException;
-import java.util.LinkedList;
-import java.util.Set;
 import java.util.ArrayList;
+import java.util.LinkedList;
 import java.util.List;
+import java.util.Set;
 import java.util.concurrent.ConcurrentHashMap;
 import java.util.concurrent.CopyOnWriteArrayList;
 import java.util.concurrent.CopyOnWriteArraySet;
@@ -28,11 +28,9 @@
 import org.apache.activemq.broker.BrokerService;
 import org.apache.activemq.broker.ConnectionContext;
 import org.apache.activemq.broker.ProducerBrokerExchange;
-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;
 import org.apache.activemq.command.ActiveMQDestination;
@@ -564,7 +562,8 @@
     protected void dispatch(final ConnectionContext context, Message message) throws Exception
{
         destinationStatistics.getMessages().increment();
         destinationStatistics.getEnqueues().increment();
-        dispatchValve.increment();      
+        dispatchValve.increment();   
+        MessageEvaluationContext msgContext = null;
         try {
             if (!subscriptionRecoveryPolicy.add(context, message)) {
                 return;
@@ -575,16 +574,18 @@
                     return;
                 }
             }
-            MessageEvaluationContext msgContext = context.getMessageEvaluationContext();
+            msgContext = context.getMessageEvaluationContext();
             msgContext.setDestination(destination);
             msgContext.setMessageReference(message);
             if (!dispatchPolicy.dispatch(message, msgContext, consumers)) {
                 onMessageWithNoConsumers(context, message);
-            }
-            msgContext.clear();
+            }  
             
         } finally {
             dispatchValve.decrement();
+            if(msgContext != null) {
+                msgContext.clear();
+            }
         }
     }
     



Mime
View raw message