Search in sources :

Example 6 with Subscription

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

the class ThreeBrokerQueueNetworkTest method verifyConsumePriority.

private void verifyConsumePriority(BrokerService broker, byte expectedPriority, Destination dest) throws Exception {
    RegionBroker regionBroker = (RegionBroker) broker.getRegionBroker();
    Queue internalQueue = (Queue) regionBroker.getDestinations(ActiveMQDestination.transform(dest)).iterator().next();
    for (Subscription consumer : internalQueue.getConsumers()) {
        assertEquals("consumer on " + broker.getBrokerName() + " matches priority: " + internalQueue, expectedPriority, consumer.getConsumerInfo().getPriority());
    }
}
Also used : RegionBroker(org.apache.activemq.broker.region.RegionBroker) Subscription(org.apache.activemq.broker.region.Subscription) Queue(org.apache.activemq.broker.region.Queue)

Aggregations

Subscription (org.apache.activemq.broker.region.Subscription)6 Destination (org.apache.activemq.broker.region.Destination)3 CountDownLatch (java.util.concurrent.CountDownLatch)2 RegionBroker (org.apache.activemq.broker.region.RegionBroker)2 ActiveMQQueue (org.apache.activemq.command.ActiveMQQueue)2 ArrayList (java.util.ArrayList)1 HashMap (java.util.HashMap)1 Destination (javax.jms.Destination)1 JMSException (javax.jms.JMSException)1 ObjectMessage (javax.jms.ObjectMessage)1 ObjectName (javax.management.ObjectName)1 ConnectionContext (org.apache.activemq.broker.ConnectionContext)1 DestinationStatistics (org.apache.activemq.broker.region.DestinationStatistics)1 DurableTopicSubscription (org.apache.activemq.broker.region.DurableTopicSubscription)1 Queue (org.apache.activemq.broker.region.Queue)1 TopicSubscription (org.apache.activemq.broker.region.TopicSubscription)1 PriorityNetworkDispatchPolicy (org.apache.activemq.broker.region.policy.PriorityNetworkDispatchPolicy)1 ActiveMQDestination (org.apache.activemq.command.ActiveMQDestination)1 ConsumerInfo (org.apache.activemq.command.ConsumerInfo)1 Test (org.junit.Test)1