mirror of https://github.com/apache/activemq.git
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:
parent
f30d42ade2
commit
ee4bb53a7d
|
@ -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){
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue