Example usage for com.rabbitmq.client ConnectionFactory DEFAULT_FRAME_MAX

List of usage examples for com.rabbitmq.client ConnectionFactory DEFAULT_FRAME_MAX

Introduction

In this page you can find the example usage for com.rabbitmq.client ConnectionFactory DEFAULT_FRAME_MAX.

Prototype

int DEFAULT_FRAME_MAX

To view the source code for com.rabbitmq.client ConnectionFactory DEFAULT_FRAME_MAX.

Click Source Link

Document

Default maximum frame size; zero means no limit

Usage

From source file:com.nxttxn.vramel.components.rabbitMQ.RabbitMQComponentTest.java

License:Apache License

@Test
public void testDefaultProperties() throws Exception {
    RabbitMQEndpoint endpoint = createEndpoint(new HashMap<String, Object>());

    assertEquals(14, endpoint.getPortNumber());
    assertEquals(10, endpoint.getThreadPoolSize());
    assertEquals(true, endpoint.isAutoAck());
    assertEquals(true, endpoint.isAutoDelete());
    assertEquals(true, endpoint.isDurable());
    assertEquals("direct", endpoint.getExchangeType());
    assertEquals(ConnectionFactory.DEFAULT_CONNECTION_TIMEOUT, endpoint.getConnectionTimeout());
    assertEquals(ConnectionFactory.DEFAULT_CHANNEL_MAX, endpoint.getRequestedChannelMax());
    assertEquals(ConnectionFactory.DEFAULT_FRAME_MAX, endpoint.getRequestedFrameMax());
    assertEquals(ConnectionFactory.DEFAULT_HEARTBEAT, endpoint.getRequestedHeartbeat());
    assertNull(endpoint.getConnectionFactory());
}

From source file:org.apache.flume.rabbitmq.source.RabbitMQSource.java

License:Apache License

@Override
public void configure(Context context) {
    hosts = context.getString(HOSTNAME, ConnectionFactory.DEFAULT_HOST);

    port = context.getInteger(PORT, ConnectionFactory.DEFAULT_AMQP_PORT);
    virtualHost = context.getString(VIRTUAL_HOST, ConnectionFactory.DEFAULT_VHOST);

    userName = context.getString(USERNAME, ConnectionFactory.DEFAULT_USER);

    password = context.getString(PASSWORD, ConnectionFactory.DEFAULT_PASS);

    connectionTimeout = context.getInteger(CONNECTION_TIMEOUT, ConnectionFactory.DEFAULT_CONNECTION_TIMEOUT);
    requestedHeartbeat = context.getInteger(REQUESTED_HEARTBEAT, ConnectionFactory.DEFAULT_HEARTBEAT);
    requestedChannelMax = context.getInteger(REQUESTED_CHANNEL_MAX, ConnectionFactory.DEFAULT_CHANNEL_MAX);
    requestedFrameMax = context.getInteger(REQUESTED_FRAMEL_MAX, ConnectionFactory.DEFAULT_FRAME_MAX);

    connectionFactory = new RabbitMQConnectionFactory.Builder().addHosts(hosts).setPort(port)
            .setVirtualHost(virtualHost).setUserName(userName).setPassword(password)
            .setConnectionTimeOut(connectionTimeout).setRequestedHeartbeat(requestedHeartbeat)
            .setRequestedChannelMax(requestedChannelMax).setRequestedFrameMax(requestedFrameMax).build();

    exchangeName = context.getString(EXCHANGE_NAME, StringUtils.EMPTY);
    queueName = context.getString(QUEUE_NAME, StringUtils.EMPTY);
    Preconditions.checkArgument(StringUtils.isNotEmpty(exchangeName) || StringUtils.isNotEmpty(queueName),
            "Atleast exchange name or queue name must be defined.");

    topics = StringUtils.split(context.getString(TOPICS, StringUtils.EMPTY), ",");

    String queueParams = context.getString(QUEUE_PARAMETERS, StringUtils.EMPTY);
    queueParameters = initializeQueueParameters(queueParams);

    batchSize = context.getInteger(BATCH_SIZE, DEFAULT_BATCH_SIZE);
}