mirror of https://github.com/apache/activemq.git
revert change to PrefetchSubscripton.isFull from fix to https://issues.apache.org/activemq/browse/AMQ-1925, updated test case to demonstrate failure
git-svn-id: https://svn.apache.org/repos/asf/activemq/trunk@694679 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
9ed183df88
commit
47130408a7
|
@ -468,7 +468,7 @@ public abstract class PrefetchSubscription extends AbstractSubscription {
|
|||
* @return
|
||||
*/
|
||||
public boolean isFull() {
|
||||
return isSlave() || dispatched.size() - prefetchExtension >= info.getPrefetchSize();
|
||||
return dispatched.size() - prefetchExtension >= info.getPrefetchSize();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -48,6 +48,13 @@ public class MasterSlaveTempQueueMemoryTest extends TempQueueMemoryTest {
|
|||
slave.start();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void tearDown() throws Exception {
|
||||
slave.stop();
|
||||
super.tearDown();
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void testLoadRequestReply() throws Exception {
|
||||
super.testLoadRequestReply();
|
||||
|
@ -62,7 +69,25 @@ public class MasterSlaveTempQueueMemoryTest extends TempQueueMemoryTest {
|
|||
RegionBroker.class);
|
||||
|
||||
//serverDestination +
|
||||
assertEquals(6, rb.getDestinationMap().size());
|
||||
assertEquals(6, rb.getDestinationMap().size());
|
||||
|
||||
RegionBroker masterRb = (RegionBroker) broker.getBroker().getAdaptor(
|
||||
RegionBroker.class);
|
||||
|
||||
// REVISIT the following two are not dependable at the moment, off by a small number
|
||||
// for some reason? The work for a COUNT < ~500
|
||||
//
|
||||
//assertEquals("inflight match", rb.getDestinationStatistics().getInflight().getCount(), masterRb.getDestinationStatistics().getInflight().getCount());
|
||||
//assertEquals("enqueues match", rb.getDestinationStatistics().getEnqueues().getCount(), masterRb.getDestinationStatistics().getEnqueues().getCount());
|
||||
|
||||
assertEquals("dequeues match",
|
||||
rb.getDestinationStatistics().getDequeues().getCount(),
|
||||
masterRb.getDestinationStatistics().getDequeues().getCount());
|
||||
|
||||
// slave does not actually dispatch any messages, so no request/reply(2) pair per iteration(COUNT)
|
||||
assertEquals("dispatched match",
|
||||
rb.getDestinationStatistics().getDispatched().getCount() + 2*COUNT,
|
||||
masterRb.getDestinationStatistics().getDispatched().getCount());
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -37,7 +37,7 @@ public class TempQueueMemoryTest extends EmbeddedBrokerTestSupport {
|
|||
private Connection clientConnection;
|
||||
private Session clientSession;
|
||||
private Destination serverDestination;
|
||||
private static final int COUNT = 1000;
|
||||
protected static final int COUNT = 2000;
|
||||
|
||||
public void testLoadRequestReply() throws Exception {
|
||||
MessageConsumer serverConsumer = serverSession.createConsumer(serverDestination);
|
||||
|
|
Loading…
Reference in New Issue