mirror of https://github.com/apache/activemq.git
Fixing DurableTopicSubscription so that an ack will properly update the forwards statistic on an ack
This commit is contained in:
parent
dd971a00f2
commit
82295fd2c6
|
@ -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
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue