use of org.apache.activemq.RedeliveryPolicy in project activemq-artemis by apache.
the class MessageListenerRedeliveryTest method getRedeliveryPolicy.
protected RedeliveryPolicy getRedeliveryPolicy() {
RedeliveryPolicy redeliveryPolicy = new RedeliveryPolicy();
redeliveryPolicy.setInitialRedeliveryDelay(0);
redeliveryPolicy.setRedeliveryDelay(1000);
redeliveryPolicy.setMaximumRedeliveries(3);
redeliveryPolicy.setBackOffMultiplier((short) 2);
redeliveryPolicy.setUseExponentialBackOff(true);
return redeliveryPolicy;
}
use of org.apache.activemq.RedeliveryPolicy in project activemq-artemis by apache.
the class RollbacksWhileConsumingLargeQueueTest method createConnectionFactory.
@Override
protected ConnectionFactory createConnectionFactory() throws Exception {
ActiveMQConnectionFactory answer = (ActiveMQConnectionFactory) super.createConnectionFactory();
RedeliveryPolicy policy = new RedeliveryPolicy();
policy.setMaximumRedeliveries(3);
policy.setRedeliveryDelay(0);
policy.setInitialRedeliveryDelay(0);
policy.setUseExponentialBackOff(false);
answer.setRedeliveryPolicy(policy);
return answer;
}
use of org.apache.activemq.RedeliveryPolicy in project activemq-artemis by apache.
the class DeadLetterTest method createConnectionFactory.
@Override
protected ActiveMQConnectionFactory createConnectionFactory() throws Exception {
ActiveMQConnectionFactory answer = super.createConnectionFactory();
RedeliveryPolicy policy = new RedeliveryPolicy();
policy.setMaximumRedeliveries(3);
policy.setBackOffMultiplier((short) 1);
policy.setInitialRedeliveryDelay(10);
policy.setUseExponentialBackOff(false);
answer.setRedeliveryPolicy(policy);
return answer;
}
use of org.apache.activemq.RedeliveryPolicy in project tomee by apache.
the class ActiveMQResourceAdapter method getActiveMQConnection.
private ActiveMQConnection getActiveMQConnection(MessageActivationSpec activationSpec, InvocationHandler invocationHandler) {
if (AutoConnectionTracker.ConnectionInvocationHandler.class.isInstance(invocationHandler)) {
final Object handle = Reflections.get(invocationHandler, "handle");
if (TomEEManagedConnectionProxy.class.isInstance(handle)) {
final ActiveMQManagedConnection c = ActiveMQManagedConnection.class.cast(Reflections.get(handle, "connection"));
final ActiveMQConnection physicalConnection = ActiveMQConnection.class.cast(Reflections.get(c, "physicalConnection"));
final RedeliveryPolicy redeliveryPolicy = activationSpec.redeliveryPolicy();
if (redeliveryPolicy != null) {
physicalConnection.setRedeliveryPolicy(redeliveryPolicy);
}
return physicalConnection;
}
}
return null;
}
use of org.apache.activemq.RedeliveryPolicy in project cxf by apache.
the class AbstractVmJMSTest method startBusAndJMS.
public static void startBusAndJMS(String brokerURI) {
bus = BusFactory.getDefaultBus();
ActiveMQConnectionFactory cf1 = new ActiveMQConnectionFactory(brokerURI);
RedeliveryPolicy redeliveryPolicy = new RedeliveryPolicy();
redeliveryPolicy.setMaximumRedeliveries(1);
redeliveryPolicy.setInitialRedeliveryDelay(1000);
cf1.setRedeliveryPolicy(redeliveryPolicy());
cf = new PooledConnectionFactory(cf1);
cff = new ConnectionFactoryFeature(cf);
}
Aggregations