tell the PendingMessageCursor how many messages you want - for more efficent polling from store

git-svn-id: https://svn.apache.org/repos/asf/activemq/trunk@504798 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Robert Davies 2007-02-08 05:55:56 +00:00
parent f30d42ade2
commit ee4bb53a7d
2 changed files with 2 additions and 0 deletions

View File

@ -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()&&count<numberToDispatch){

View File

@ -899,6 +899,7 @@ public class Queue implements Destination, Task {
final int toPageIn=maximumPagedInMessages-pagedInMessages.size();
List result=null;
if((force||!consumers.isEmpty())&&toPageIn>0){
messages.setMaxBatchSize(toPageIn);
try{
dispatchValve.increment();
int count=0;