activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rajdav...@apache.org
Subject svn commit: r729703 - /activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/region/TopicSubscription.java
Date Sun, 28 Dec 2008 08:13:05 GMT
Author: rajdavies
Date: Sun Dec 28 00:13:05 2008
New Revision: 729703

URL: http://svn.apache.org/viewvc?rev=729703&view=rev
Log:
Fix for https://issues.apache.org/activemq/browse/AMQ-2043

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

Modified: activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/region/TopicSubscription.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/region/TopicSubscription.java?rev=729703&r1=729702&r2=729703&view=diff
==============================================================================
--- activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/region/TopicSubscription.java
(original)
+++ activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/region/TopicSubscription.java
Sun Dec 28 00:13:05 2008
@@ -218,7 +218,9 @@
             // Message was delivered but not acknowledged: update pre-fetch
             // counters.
             dequeueCounter.addAndGet(ack.getMessageCount());
-            destination.getDestinationStatistics().getInflight().subtract(ack.getMessageCount());
+            if (destination != null) {
+                destination.getDestinationStatistics().getInflight().subtract(ack.getMessageCount());
+            }
             dispatchMatched();
             return;
         }
@@ -436,8 +438,10 @@
         matched.remove(message);
         discarded++;
         dequeueCounter.incrementAndGet();
-        destination.getDestinationStatistics().getDequeues().increment();
-        destination.getDestinationStatistics().getInflight().decrement();
+        if(destination != null) {
+            destination.getDestinationStatistics().getDequeues().increment();
+            destination.getDestinationStatistics().getInflight().decrement();
+        }
         if (LOG.isDebugEnabled()) {
             LOG.debug("Discarding message " + message);
         }



Mime
View raw message