use of org.apache.activemq.RedeliveryPolicy in project cxf by apache.
the class AbstractVmJMSTest method redeliveryPolicy.
protected static RedeliveryPolicy redeliveryPolicy() {
RedeliveryPolicy redeliveryPolicy = new RedeliveryPolicy();
redeliveryPolicy.setMaximumRedeliveries(1);
redeliveryPolicy.setInitialRedeliveryDelay(1000);
return redeliveryPolicy;
}
use of org.apache.activemq.RedeliveryPolicy in project Protocol-Adapter-OSLP by OSGP.
the class MessagingConfig method defaultRedeliveryPolicy.
// === JMS SETTINGS ===
@Override
@Bean
public RedeliveryPolicy defaultRedeliveryPolicy() {
final RedeliveryPolicy redeliveryPolicy = new RedeliveryPolicy();
redeliveryPolicy.setInitialRedeliveryDelay(Long.parseLong(this.environment.getRequiredProperty(PROPERTY_NAME_JMS_DEFAULT_INITIAL_REDELIVERY_DELAY)));
redeliveryPolicy.setMaximumRedeliveries(Integer.parseInt(this.environment.getRequiredProperty(PROPERTY_NAME_JMS_DEFAULT_MAXIMUM_REDELIVERIES)));
redeliveryPolicy.setMaximumRedeliveryDelay(Long.parseLong(this.environment.getRequiredProperty(PROPERTY_NAME_JMS_DEFAULT_MAXIMUM_REDELIVERY_DELAY)));
redeliveryPolicy.setRedeliveryDelay(Long.parseLong(this.environment.getRequiredProperty(PROPERTY_NAME_JMS_DEFAULT_REDELIVERY_DELAY)));
redeliveryPolicy.setBackOffMultiplier(Double.parseDouble(this.environment.getRequiredProperty(PROPERTY_NAME_JMS_DEFAULT_BACK_OFF_MULTIPLIER)));
redeliveryPolicy.setUseExponentialBackOff(Boolean.parseBoolean(this.environment.getRequiredProperty(PROPERTY_NAME_JMS_DEFAULT_USE_EXPONENTIAL_BACK_OFF)));
return redeliveryPolicy;
}
use of org.apache.activemq.RedeliveryPolicy in project elephant by yanghuijava.
the class ActivemqConfig method redeliveryPolicy.
@Bean
public RedeliveryPolicy redeliveryPolicy() {
RedeliveryPolicy redeliveryPolicy = new RedeliveryPolicy();
redeliveryPolicy.setInitialRedeliveryDelay(5000);
redeliveryPolicy.setRedeliveryDelay(this.mqProperties.getRedeliveryDelay());
redeliveryPolicy.setBackOffMultiplier(1);
redeliveryPolicy.setUseExponentialBackOff(true);
redeliveryPolicy.setMaximumRedeliveries(-1);
return redeliveryPolicy;
}
use of org.apache.activemq.RedeliveryPolicy in project activemq-artemis by apache.
the class NonBlockingConsumerRedeliveryTest method startBroker.
@Before
public void startBroker() throws Exception {
broker = new BrokerService();
broker.setDeleteAllMessagesOnStartup(true);
broker.setPersistent(false);
broker.setUseJmx(false);
broker.addConnector("tcp://0.0.0.0:0");
broker.start();
broker.waitUntilStarted();
connectionUri = broker.getTransportConnectors().get(0).getPublishableConnectString();
connectionFactory = new ActiveMQConnectionFactory(connectionUri);
connectionFactory.setNonBlockingRedelivery(true);
RedeliveryPolicy policy = connectionFactory.getRedeliveryPolicy();
policy.setInitialRedeliveryDelay(TimeUnit.SECONDS.toMillis(2));
policy.setBackOffMultiplier(-1);
policy.setRedeliveryDelay(TimeUnit.SECONDS.toMillis(2));
policy.setMaximumRedeliveryDelay(-1);
policy.setUseExponentialBackOff(false);
policy.setMaximumRedeliveries(-1);
}
use of org.apache.activemq.RedeliveryPolicy in project activemq-artemis by apache.
the class MessageListenerDeadLetterTest method createConnectionFactory.
@Override
protected ActiveMQConnectionFactory createConnectionFactory() throws Exception {
ActiveMQConnectionFactory answer = super.createConnectionFactory();
RedeliveryPolicy policy = new RedeliveryPolicy();
policy.setMaximumRedeliveries(3);
policy.setBackOffMultiplier((short) 1);
policy.setRedeliveryDelay(0);
policy.setInitialRedeliveryDelay(0);
policy.setUseExponentialBackOff(false);
answer.setRedeliveryPolicy(policy);
return answer;
}
Aggregations