Search in sources :

Example 1 with DemandForwardingBridgeSupport

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();
        }
    }));
}
Also used : BrokerService(org.apache.activemq.broker.BrokerService) DemandForwardingBridgeSupport(org.apache.activemq.network.DemandForwardingBridgeSupport)

Aggregations

BrokerService (org.apache.activemq.broker.BrokerService)1 DemandForwardingBridgeSupport (org.apache.activemq.network.DemandForwardingBridgeSupport)1