Any objections if I merge the following change into the 5.3 branch? It's been bothering me that topics would report a 'queue size'.
Regards, Hiram ---------- Forwarded message ---------- From: <[email protected]> Date: Thu, Jan 28, 2010 at 3:00 PM Subject: svn commit: r904243 - /activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/region/Topic.java To: [email protected] 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(); -- Regards, Hiram Blog: http://hiramchirino.com Open Source SOA http://fusesource.com/
