Author: rajdavies
Date: Fri Sep 25 08:36:16 2009
New Revision: 818768
URL: http://svn.apache.org/viewvc?rev=818768&view=rev
Log:
Merged /activemq/trunk:r818724-818762
Added:
activemq/branches/activemq-5.3/activemq-core/src/test/java/org/apache/activemq/bugs/AMQ2413Test.java
- copied unchanged from r818762, activemq/trunk/activemq-core/src/test/java/org/apache/activemq/bugs/AMQ2413Test.java
Modified:
activemq/branches/activemq-5.3/ (props changed)
activemq/branches/activemq-5.3/activemq-core/src/main/java/org/apache/activemq/broker/region/Queue.java
Propchange: activemq/branches/activemq-5.3/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Fri Sep 25 08:36:16 2009
@@ -1 +1 @@
-/activemq/trunk:816278-816279,816298,818138,818140-818147,818155,818160-818176,818209,818211,818224-818262,818480,818484,818487,818496,818502,818504-818510,818513-818516,818609,818635
+/activemq/trunk:816278-816279,816298,818138,818140-818147,818155,818160-818176,818209,818211,818224-818262,818480,818484,818487,818496,818502,818504-818510,818513-818516,818609,818635,818724-818762
Modified: activemq/branches/activemq-5.3/activemq-core/src/main/java/org/apache/activemq/broker/region/Queue.java
URL: http://svn.apache.org/viewvc/activemq/branches/activemq-5.3/activemq-core/src/main/java/org/apache/activemq/broker/region/Queue.java?rev=818768&r1=818767&r2=818768&view=diff
==============================================================================
--- activemq/branches/activemq-5.3/activemq-core/src/main/java/org/apache/activemq/broker/region/Queue.java
(original)
+++ activemq/branches/activemq-5.3/activemq-core/src/main/java/org/apache/activemq/broker/region/Queue.java
Fri Sep 25 08:36:16 2009
@@ -1339,15 +1339,13 @@
List<QueueMessageReference> result = null;
List<QueueMessageReference> resultList = null;
synchronized(dispatchMutex) {
- int toPageIn = getMaxPageSize() + Math.max(0, (int)destinationStatistics.getInflight().getCount())
- pagedInMessages.size();
-
+ int toPageIn = Math.min(getMaxPageSize(), messages.size());
if (LOG.isDebugEnabled()) {
LOG.debug(destination.getPhysicalName() + " toPageIn: " + toPageIn + ",
Inflight: "
+ destinationStatistics.getInflight().getCount()
+ ", pagedInMessages.size " + pagedInMessages.size());
}
-
- toPageIn = Math.max(0, Math.min(toPageIn, getMaxPageSize()));
+
if (isLazyDispatch()&& !force) {
// Only page in the minimum number of messages which can be dispatched immediately.
toPageIn = Math.min(getConsumerMessageCountBeforeFull(), toPageIn);
|