Search in sources :

Example 1 with RedeliveryPlugin

use of org.apache.activemq.broker.util.RedeliveryPlugin in project activemq-artemis by apache.

the class BrokerRedeliveryTest method startBroker.

private void startBroker(boolean deleteMessages) throws Exception {
    broker = new BrokerService();
    broker.setSchedulerSupport(true);
    RedeliveryPlugin redeliveryPlugin = new RedeliveryPlugin();
    RedeliveryPolicy brokerRedeliveryPolicy = new RedeliveryPolicy();
    brokerRedeliveryPolicy.setRedeliveryDelay(redeliveryDelayMillis);
    brokerRedeliveryPolicy.setInitialRedeliveryDelay(initialRedeliveryDelayMillis);
    brokerRedeliveryPolicy.setMaximumRedeliveries(maxBrokerRedeliveries);
    RedeliveryPolicyMap redeliveryPolicyMap = new RedeliveryPolicyMap();
    redeliveryPolicyMap.setDefaultEntry(brokerRedeliveryPolicy);
    redeliveryPlugin.setRedeliveryPolicyMap(redeliveryPolicyMap);
    broker.setPlugins(new BrokerPlugin[] { redeliveryPlugin });
    if (deleteMessages) {
        broker.setDeleteAllMessagesOnStartup(true);
    }
    broker.start();
}
Also used : RedeliveryPlugin(org.apache.activemq.broker.util.RedeliveryPlugin) RedeliveryPolicy(org.apache.activemq.RedeliveryPolicy) RedeliveryPolicyMap(org.apache.activemq.broker.region.policy.RedeliveryPolicyMap)

Aggregations

RedeliveryPolicy (org.apache.activemq.RedeliveryPolicy)1 RedeliveryPolicyMap (org.apache.activemq.broker.region.policy.RedeliveryPolicyMap)1 RedeliveryPlugin (org.apache.activemq.broker.util.RedeliveryPlugin)1