AMQ-1632. Correct prefetch size instead of trying to push messages more often

git-svn-id: https://svn.apache.org/repos/asf/activemq/branches/activemq-4.1@640626 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
David Jencks 2008-03-24 22:42:25 +00:00
parent 837d08165d
commit 808f84b9f7
2 changed files with 3 additions and 3 deletions

View File

@ -181,7 +181,6 @@ abstract public class PrefetchSubscription extends AbstractSubscription{
dispatched.remove(node);
node.getRegionDestination().getDestinationStatistics().getDequeues().increment();
prefetchExtension=Math.max(0,prefetchExtension-1);
dispatchMatched();
}
}

View File

@ -153,20 +153,21 @@ public class ActiveMQEndpointWorker {
}
});
int prefetchSize = activationSpec.getMaxMessagesPerSessionsIntValue() * activationSpec.getMaxSessionsIntValue();
if (activationSpec.isDurableSubscription()) {
consumer = connection.createDurableConnectionConsumer(
(Topic) dest,
activationSpec.getSubscriptionName(),
emptyToNull(activationSpec.getMessageSelector()),
serverSessionPool,
activationSpec.getMaxMessagesPerSessionsIntValue(),
prefetchSize,
activationSpec.getNoLocalBooleanValue());
} else {
consumer = connection.createConnectionConsumer(
dest,
emptyToNull(activationSpec.getMessageSelector()),
serverSessionPool,
activationSpec.getMaxMessagesPerSessionsIntValue(),
prefetchSize,
activationSpec.getNoLocalBooleanValue());
}