diff --git a/activemq-core/src/main/java/org/apache/activemq/broker/region/Queue.java b/activemq-core/src/main/java/org/apache/activemq/broker/region/Queue.java index 387bb1c434..a349dc8157 100755 --- a/activemq-core/src/main/java/org/apache/activemq/broker/region/Queue.java +++ b/activemq-core/src/main/java/org/apache/activemq/broker/region/Queue.java @@ -364,7 +364,7 @@ public class Queue extends BaseDestination implements Task, UsageListener { messages.setUseCache(isUseCache()); messages.setMemoryUsageHighWaterMark(getCursorMemoryHighWaterMark()); final int messageCount = store.getMessageCount(); - if (messages.isRecoveryRequired()) { + if (messageCount > 0 && messages.isRecoveryRequired()) { BatchMessageRecoveryListener listener = new BatchMessageRecoveryListener(messageCount); do { listener.reset();