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 64f1da2cba..ff55e2f546 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 @@ -1869,12 +1869,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(); }