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 3cdd91c29b..af7cfe9f14 100755 --- 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 @@ -1232,10 +1232,10 @@ public class Queue extends BaseDestination implements Task, UsageListener { } finally { pagedInMessagesLock.readLock().unlock(); } - int messagesInQueue = 0; + int messagesInQueue = alreadyPagedIn; messagesLock.readLock().lock(); try { - messagesInQueue = messages.size(); + messagesInQueue += messages.size(); } finally { messagesLock.readLock().unlock(); }