diff --git a/activemq-broker/src/main/java/org/apache/activemq/broker/region/DurableTopicSubscription.java b/activemq-broker/src/main/java/org/apache/activemq/broker/region/DurableTopicSubscription.java index 7c43662aa5..25f71ae425 100755 --- a/activemq-broker/src/main/java/org/apache/activemq/broker/region/DurableTopicSubscription.java +++ b/activemq-broker/src/main/java/org/apache/activemq/broker/region/DurableTopicSubscription.java @@ -328,6 +328,9 @@ public class DurableTopicSubscription extends PrefetchSubscription implements Us redeliveredMessages.remove(node.getMessageId()); node.decrementReferenceCount(); ((Destination)node.getRegionDestination()).getDestinationStatistics().getDequeues().increment(); + if (info.isNetworkSubscription()) { + ((Destination)node.getRegionDestination()).getDestinationStatistics().getForwards().add(ack.getMessageCount()); + } } @Override diff --git a/activemq-unit-tests/src/test/java/org/apache/activemq/network/SimpleNetworkTest.java b/activemq-unit-tests/src/test/java/org/apache/activemq/network/SimpleNetworkTest.java index 8a58eed267..5d3376bde6 100755 --- a/activemq-unit-tests/src/test/java/org/apache/activemq/network/SimpleNetworkTest.java +++ b/activemq-unit-tests/src/test/java/org/apache/activemq/network/SimpleNetworkTest.java @@ -16,6 +16,7 @@ */ package org.apache.activemq.network; +import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertNull; import static org.junit.Assert.assertTrue; @@ -211,6 +212,11 @@ public class SimpleNetworkTest { producer.send(test); } Thread.sleep(1000); + + //Make sure stats are set + assertEquals(MESSAGE_COUNT, + localBroker.getDestination(included).getDestinationStatistics().getForwards().getCount()); + // close everything down and restart doTearDown(); doSetUp(false);