org.apache.activemq.broker.util.RedeliveryPlugin

Here are the examples of the java api class org.apache.activemq.broker.util.RedeliveryPlugin taken from open source projects.

1. BrokerRedeliveryTest#startBroker()

View license
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();
}