From 79fae8c00ba60c46b913c6b39370b20c6d15e6ac Mon Sep 17 00:00:00 2001 From: "Christopher L. Shannon (cshannon)" Date: Wed, 18 Apr 2018 12:35:10 -0400 Subject: [PATCH] Revert "AMQ-6947 - Make sure counters are updated correct on message drop" This reverts commit 1fe096cb2a3ec03dbf5a7aab05c0960f8c739339. --- .../main/java/org/apache/activemq/broker/region/Queue.java | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/activemq-broker/src/main/java/org/apache/activemq/broker/region/Queue.java b/activemq-broker/src/main/java/org/apache/activemq/broker/region/Queue.java index 2946ac538c..48cbfbe5ab 100644 --- a/activemq-broker/src/main/java/org/apache/activemq/broker/region/Queue.java +++ b/activemq-broker/src/main/java/org/apache/activemq/broker/region/Queue.java @@ -1839,12 +1839,11 @@ public class Queue extends BaseDestination implements Task, UsageListener, Index private void dropMessage(QueueMessageReference reference) { //use dropIfLive so we only process the statistics at most one time if (reference.dropIfLive()) { + getDestinationStatistics().getDequeues().increment(); + getDestinationStatistics().getMessages().decrement(); pagedInMessagesLock.writeLock().lock(); try { - if (pagedInMessages.remove(reference) != null) { - getDestinationStatistics().getDequeues().increment(); - getDestinationStatistics().getMessages().decrement(); - } + pagedInMessages.remove(reference); } finally { pagedInMessagesLock.writeLock().unlock(); }