diff --git a/activemq-core/src/main/java/org/apache/activemq/broker/BrokerService.java b/activemq-core/src/main/java/org/apache/activemq/broker/BrokerService.java index 7aa5082d7f..0b7f4964bc 100644 --- a/activemq-core/src/main/java/org/apache/activemq/broker/BrokerService.java +++ b/activemq-core/src/main/java/org/apache/activemq/broker/BrokerService.java @@ -639,7 +639,7 @@ public class BrokerService implements Service { if (entry.getKey().isQueue()) { if (entry.getValue().getName().matches(queueName)) { queueSize = entry.getValue().getDestinationStatistics().getMessages().getCount(); - count = queueSize; + count += queueSize; if (queueSize > 0) { LOG.info("Queue has pending message:" + entry.getValue().getName() + " queueSize is:" + queueSize);