Search in sources :

Example 1 with TopicSubscription

use of org.apache.activemq.broker.region.TopicSubscription in project activemq-artemis by apache.

the class PriorityNetworkDispatchPolicyTest method testRemoveLowerPriorityDup.

@Test
public void testRemoveLowerPriorityDup() throws Exception {
    List<Subscription> consumers = new ArrayList<>();
    for (int i = 0; i < 3; i++) {
        ConsumerInfo instance = info.copy();
        instance.setPriority((byte) i);
        consumers.add(new TopicSubscription(brokerService.getBroker(), context, instance, usageManager));
    }
    underTest.dispatch(node, null, consumers);
    long count = 0;
    for (Subscription consumer : consumers) {
        count += consumer.getEnqueueCounter();
    }
    assertEquals("only one sub got message", 1, count);
}
Also used : ConsumerInfo(org.apache.activemq.command.ConsumerInfo) TopicSubscription(org.apache.activemq.broker.region.TopicSubscription) ArrayList(java.util.ArrayList) Subscription(org.apache.activemq.broker.region.Subscription) TopicSubscription(org.apache.activemq.broker.region.TopicSubscription) Test(org.junit.Test)

Aggregations

ArrayList (java.util.ArrayList)1 Subscription (org.apache.activemq.broker.region.Subscription)1 TopicSubscription (org.apache.activemq.broker.region.TopicSubscription)1 ConsumerInfo (org.apache.activemq.command.ConsumerInfo)1 Test (org.junit.Test)1