use of com.rabbitmq.client.ConnectionFactory in project rabbitmq-java-client by rabbitmq.
the class ChannelLimitNegotiation method channelMaxLowerThanServerMinimum.
@Test
public void channelMaxLowerThanServerMinimum() throws Exception {
int n = 64;
ConnectionFactory cf = TestUtils.connectionFactory();
cf.setRequestedChannelMax(n);
try (Connection conn = cf.newConnection()) {
assertEquals(n, conn.getChannelMax());
}
}
use of com.rabbitmq.client.ConnectionFactory in project rabbitmq-java-client by rabbitmq.
the class Heartbeat method newConnectionFactory.
@Override
protected ConnectionFactory newConnectionFactory() {
ConnectionFactory cf = super.newConnectionFactory();
cf.setRequestedHeartbeat(1);
return cf;
}
use of com.rabbitmq.client.ConnectionFactory in project rabbitmq-java-client by rabbitmq.
the class Metrics method createConnectionFactory.
private static ConnectionFactory createConnectionFactory() {
ConnectionFactory connectionFactory = TestUtils.connectionFactory();
connectionFactory.setAutomaticRecoveryEnabled(false);
return connectionFactory;
}
use of com.rabbitmq.client.ConnectionFactory in project rabbitmq-java-client by rabbitmq.
the class ExchangeDeclare method exchangeDeclaredWithEnumerationEquivalentOnRecoverableConnection.
@Test
public void exchangeDeclaredWithEnumerationEquivalentOnRecoverableConnection() throws IOException, TimeoutException, InterruptedException {
ConnectionFactory connectionFactory = TestUtils.connectionFactory();
connectionFactory.setAutomaticRecoveryEnabled(true);
connectionFactory.setTopologyRecoveryEnabled(false);
Connection c = connectionFactory.newConnection();
try {
doTestExchangeDeclaredWithEnumerationEquivalent(c.createChannel());
} finally {
c.abort();
}
}
use of com.rabbitmq.client.ConnectionFactory in project rabbitmq-java-client by rabbitmq.
the class FrameMax method rejectLargeFramesDuringConnectionNegotiation.
/* server should reject frames larger than AMQP.FRAME_MIN_SIZE
* during connection negotiation */
@Test
public void rejectLargeFramesDuringConnectionNegotiation() throws IOException, TimeoutException {
ConnectionFactory cf = TestUtils.connectionFactory();
cf.getClientProperties().put("too_long", LongStringHelper.asLongString(new byte[AMQP.FRAME_MIN_SIZE]));
try {
cf.newConnection();
fail("Expected exception during connection negotiation");
} catch (IOException e) {
}
}
Aggregations