You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@activemq.apache.org by ch...@apache.org on 2010/01/28 21:00:48 UTC

svn commit: r904243 - /activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/region/Topic.java

Author: chirino
Date: Thu Jan 28 20:00:48 2010
New Revision: 904243

URL: http://svn.apache.org/viewvc?rev=904243&view=rev
Log:
Fix for AMQ-2586 
Topics will now report a queue size of 0.


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=904243&r1=904242&r2=904243&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 Jan 28 20:00:48 2010
@@ -90,8 +90,9 @@
     public void initialize() throws Exception {
         super.initialize();
         if (store != null) {
-            int messageCount = store.getMessageCount();
-            destinationStatistics.getMessages().setCount(messageCount);
+            // AMQ-2586: Better to leave this stat at zero than to give the user misleading metrics.
+            // int messageCount = store.getMessageCount();
+            // destinationStatistics.getMessages().setCount(messageCount);
         }
     }
 
@@ -563,7 +564,8 @@
     }
 
     protected void dispatch(final ConnectionContext context, Message message) throws Exception {
-        destinationStatistics.getMessages().increment();
+        // AMQ-2586: Better to leave this stat at zero than to give the user misleading metrics.
+        // destinationStatistics.getMessages().increment();
         destinationStatistics.getEnqueues().increment();
         dispatchValve.increment();
         MessageEvaluationContext msgContext = null;
@@ -594,7 +596,8 @@
 
     public void messageExpired(ConnectionContext context, Subscription subs, MessageReference reference) {
         broker.messageExpired(context, reference);
-        destinationStatistics.getMessages().decrement();
+        // AMQ-2586: Better to leave this stat at zero than to give the user misleading metrics.
+        // destinationStatistics.getMessages().decrement();
         destinationStatistics.getEnqueues().decrement();
         destinationStatistics.getExpired().increment();
         MessageAck ack = new MessageAck();