use of com.rabbitmq.jms.admin.RMQConnectionFactory in project rabbitmq-jms-client by rabbitmq.
the class RequeueMessageOnTimeoutIT method connection.
private QueueConnection connection(boolean requeueOnException, boolean requeueOnTimeout) throws Exception {
RMQConnectionFactory connectionFactory = (RMQConnectionFactory) AbstractTestConnectionFactory.getTestConnectionFactory().getConnectionFactory();
connectionFactory.setRequeueOnMessageListenerException(requeueOnException);
connectionFactory.setRequeueOnTimeout(requeueOnTimeout);
connectionFactory.setOnMessageTimeoutMs(REQUEUE_TIMEOUT_MS);
QueueConnection queueConnection = connectionFactory.createQueueConnection();
queueConnection.start();
return queueConnection;
}
use of com.rabbitmq.jms.admin.RMQConnectionFactory in project rabbitmq-jms-client by rabbitmq.
the class RequeueMessageOnListenerExceptionIT method connection.
private QueueConnection connection(int qos) throws Exception {
RMQConnectionFactory connectionFactory = (RMQConnectionFactory) AbstractTestConnectionFactory.getTestConnectionFactory().getConnectionFactory();
connectionFactory.setChannelsQos(qos);
connectionFactory.setRequeueOnMessageListenerException(true);
QueueConnection queueConnection = connectionFactory.createQueueConnection();
queueConnection.start();
return queueConnection;
}
use of com.rabbitmq.jms.admin.RMQConnectionFactory in project rabbitmq-jms-client by rabbitmq.
the class SslContextIT method useDefaultSslContextWhenOptionIsEnabled.
@Test
public void useDefaultSslContextWhenOptionIsEnabled() throws Exception {
RMQConnectionFactory connectionFactory = (RMQConnectionFactory) AbstractTestConnectionFactory.getTestConnectionFactory(true, 0).getConnectionFactory();
SSLContext defaultSslContext = createSslContext();
AlwaysTrustTrustManager defaultTrustManager = new AlwaysTrustTrustManager();
defaultSslContext.init(null, new TrustManager[] { defaultTrustManager }, null);
SSLContext.setDefault(defaultSslContext);
connectionFactory.useDefaultSslContext(true);
connection = connectionFactory.createConnection();
assertTrue(defaultTrustManager.checkServerTrustedCallCount.get() >= 1, "TrustManager#checkServerTrusted must be called");
}
use of com.rabbitmq.jms.admin.RMQConnectionFactory in project rabbitmq-jms-client by rabbitmq.
the class ReceivingContextConsumerIT method init.
@BeforeEach
public void init() throws Exception {
RMQConnectionFactory connectionFactory = (RMQConnectionFactory) AbstractTestConnectionFactory.getTestConnectionFactory().getConnectionFactory();
connectionFactory.setReceivingContextConsumer(ctx -> receivedCount.incrementAndGet());
connection = connectionFactory.createConnection();
connection.start();
}
use of com.rabbitmq.jms.admin.RMQConnectionFactory in project rabbitmq-jms-client by rabbitmq.
the class NackMessageOnRollbackIT method connection.
private QueueConnection connection() throws Exception {
RMQConnectionFactory connectionFactory = (RMQConnectionFactory) AbstractTestConnectionFactory.getTestConnectionFactory().getConnectionFactory();
connectionFactory.setNackOnRollback(true);
QueueConnection queueConnection = connectionFactory.createQueueConnection();
queueConnection.start();
return queueConnection;
}
Aggregations