use of org.apache.activemq.network.DemandForwardingBridgeSupport in project activemq-artemis by apache.
the class TwoBrokerQueueSendReceiveTest method testReceiveOnXConsumersNoLeak.
public void testReceiveOnXConsumersNoLeak() throws Exception {
consumer.close();
sendMessages();
for (int i = 0; i < data.length; i++) {
consumer = createConsumer();
onMessage(consumer.receive(10000));
consumer.close();
}
waitForMessagesToBeDelivered();
assertEquals("Got all messages", data.length, messages.size());
BrokerService broker = brokers.get("receiver");
final DemandForwardingBridgeSupport bridge = (DemandForwardingBridgeSupport) broker.getNetworkConnectors().get(0).activeBridges().toArray()[0];
assertTrue("No extra, size:" + bridge.getLocalSubscriptionMap().size(), Wait.waitFor(new Wait.Condition() {
@Override
public boolean isSatisified() throws Exception {
LOG.info("local subs map size = " + bridge.getLocalSubscriptionMap().size());
return 0 == bridge.getLocalSubscriptionMap().size();
}
}));
}
Aggregations