git-svn-id: https://svn.apache.org/repos/asf/activemq/trunk@680161 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Robert Davies 2008-07-27 18:22:01 +00:00
parent 08e01e7fb4
commit 7614fe25b7
2 changed files with 5 additions and 1 deletions

View File

@ -1164,7 +1164,7 @@ public class Queue extends BaseDestination implements Task {
// pick the least loaded to add the message too // pick the least loaded to add the message too
for (Subscription s : targets) { for (Subscription s : targets) {
if (target == null if (target == null
|| target.getInFlightUsage() > s.getInFlightUsage()) { || target.getPendingQueueSize() > s.getPendingQueueSize()) {
target = s; target = s;
} }
} }

View File

@ -33,6 +33,7 @@ import org.apache.activemq.broker.BrokerService;
import org.apache.activemq.broker.region.policy.PolicyEntry; import org.apache.activemq.broker.region.policy.PolicyEntry;
import org.apache.activemq.broker.region.policy.PolicyMap; import org.apache.activemq.broker.region.policy.PolicyMap;
import org.apache.activemq.command.ActiveMQQueue; import org.apache.activemq.command.ActiveMQQueue;
import org.apache.activemq.store.amq.AMQPersistenceAdapter;
import org.apache.commons.logging.Log; import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory; import org.apache.commons.logging.LogFactory;
@ -60,6 +61,9 @@ public class AMQ1866 extends TestCase {
protected void setUp() throws Exception { protected void setUp() throws Exception {
// Start an embedded broker up. // Start an embedded broker up.
brokerService = new BrokerService(); brokerService = new BrokerService();
AMQPersistenceAdapter adaptor = new AMQPersistenceAdapter();
adaptor.setIndexBinSize(4096);
brokerService.setPersistenceAdapter(adaptor);
brokerService.deleteAllMessages(); brokerService.deleteAllMessages();
// A small max page size makes this issue occur faster. // A small max page size makes this issue occur faster.