diff --git a/activemq-core/src/main/java/org/apache/activemq/broker/region/PrefetchSubscription.java b/activemq-core/src/main/java/org/apache/activemq/broker/region/PrefetchSubscription.java index ba0bb9a3b2..8872f55d85 100755 --- a/activemq-core/src/main/java/org/apache/activemq/broker/region/PrefetchSubscription.java +++ b/activemq-core/src/main/java/org/apache/activemq/broker/region/PrefetchSubscription.java @@ -385,6 +385,7 @@ abstract public class PrefetchSubscription extends AbstractSubscription{ try{ int numberToDispatch=countBeforeFull(); if(numberToDispatch>0){ + pending.setMaxBatchSize(numberToDispatch); int count=0; pending.reset(); while(pending.hasNext()&&!isFull()&&count0){ + messages.setMaxBatchSize(toPageIn); try{ dispatchValve.increment(); int count=0;