Search in sources :

Example 1 with PriorityDispatchPolicy

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

the class RequestReplyTempDestRemovalAdvisoryRaceTest method setUp.

@Override
protected void setUp() throws Exception {
    super.setUp();
    responseReceived.set(0);
    respondentSendError.set(0);
    forwardFailures.set(0);
    sendsWithNoConsumers.set(0);
    networkConnectors.clear();
    advisoryConsumerConnections.clear();
    consumerDemandExists = new CountDownLatch(1);
    createBroker(new URI("broker:(tcp://localhost:0)/" + BROKER_A + "?persistent=false&useJmx=false")).setDedicatedTaskRunner(false);
    createBroker(new URI("broker:(tcp://localhost:0)/" + BROKER_B + "?persistent=false&useJmx=false")).setDedicatedTaskRunner(false);
    createBroker(new URI("broker:(tcp://localhost:0)/" + BROKER_C + "?persistent=false&useJmx=false")).setDedicatedTaskRunner(false);
    PolicyMap map = new PolicyMap();
    PolicyEntry defaultEntry = new PolicyEntry();
    defaultEntry.setSendAdvisoryIfNoConsumers(true);
    DeadLetterStrategy deadletterStrategy = new SharedDeadLetterStrategy();
    deadletterStrategy.setProcessNonPersistent(true);
    defaultEntry.setDeadLetterStrategy(deadletterStrategy);
    defaultEntry.setDispatchPolicy(new PriorityDispatchPolicy());
    map.put(new ActiveMQTempTopic(">"), defaultEntry);
    for (BrokerItem item : brokers.values()) {
        item.broker.setDestinationPolicy(map);
    }
}
Also used : PriorityDispatchPolicy(org.apache.activemq.broker.region.policy.PriorityDispatchPolicy) PolicyMap(org.apache.activemq.broker.region.policy.PolicyMap) ActiveMQTempTopic(org.apache.activemq.command.ActiveMQTempTopic) SharedDeadLetterStrategy(org.apache.activemq.broker.region.policy.SharedDeadLetterStrategy) DeadLetterStrategy(org.apache.activemq.broker.region.policy.DeadLetterStrategy) CountDownLatch(java.util.concurrent.CountDownLatch) SharedDeadLetterStrategy(org.apache.activemq.broker.region.policy.SharedDeadLetterStrategy) URI(java.net.URI) PolicyEntry(org.apache.activemq.broker.region.policy.PolicyEntry)

Aggregations

URI (java.net.URI)1 CountDownLatch (java.util.concurrent.CountDownLatch)1 DeadLetterStrategy (org.apache.activemq.broker.region.policy.DeadLetterStrategy)1 PolicyEntry (org.apache.activemq.broker.region.policy.PolicyEntry)1 PolicyMap (org.apache.activemq.broker.region.policy.PolicyMap)1 PriorityDispatchPolicy (org.apache.activemq.broker.region.policy.PriorityDispatchPolicy)1 SharedDeadLetterStrategy (org.apache.activemq.broker.region.policy.SharedDeadLetterStrategy)1 ActiveMQTempTopic (org.apache.activemq.command.ActiveMQTempTopic)1