Revert "AMQ-6947 - Make sure counters are updated correct on message drop"
This reverts commit 1fe096cb2a3ec03dbf5a7aab05c0960f8c739339. Project: http://git-wip-us.apache.org/repos/asf/activemq/repo Commit: http://git-wip-us.apache.org/repos/asf/activemq/commit/79fae8c0 Tree: http://git-wip-us.apache.org/repos/asf/activemq/tree/79fae8c0 Diff: http://git-wip-us.apache.org/repos/asf/activemq/diff/79fae8c0 Branch: refs/heads/activemq-5.15.x Commit: 79fae8c00ba60c46b913c6b39370b20c6d15e6ac Parents: 86fbf95 Author: Christopher L. Shannon (cshannon) <[email protected]> Authored: Wed Apr 18 12:35:10 2018 -0400 Committer: Christopher L. Shannon (cshannon) <[email protected]> Committed: Wed Apr 18 12:35:10 2018 -0400 ---------------------------------------------------------------------- .../main/java/org/apache/activemq/broker/region/Queue.java | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/activemq/blob/79fae8c0/activemq-broker/src/main/java/org/apache/activemq/broker/region/Queue.java ---------------------------------------------------------------------- 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 2946ac5..48cbfbe 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(); }
