当前位置: 首页>>代码示例>>Java>>正文


Java NioParams类代码示例

本文整理汇总了Java中com.rabbitmq.client.impl.nio.NioParams的典型用法代码示例。如果您正苦于以下问题:Java NioParams类的具体用法?Java NioParams怎么用?Java NioParams使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


NioParams类属于com.rabbitmq.client.impl.nio包,在下文中一共展示了NioParams类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: setBasicProperties

import com.rabbitmq.client.impl.nio.NioParams; //导入依赖的package包/类
private void setBasicProperties () {
    final NioParams nioParams = new NioParams()
            .setNbIoThreads(1)
            .setWriteEnqueuingTimeoutInMs(0)
            .setWriteByteBufferSize(VALUE_SET_WRITE_BUFFER_SIZE);

    RABBITMQ_CONNECTION_FACTORY.useNio();
    RABBITMQ_CONNECTION_FACTORY.setNioParams(nioParams);
    RABBITMQ_CONNECTION_FACTORY.setConnectionTimeout(VALUE_CONNECTION_TIMEOUT_MS);
    RABBITMQ_CONNECTION_FACTORY.setChannelRpcTimeout(VALUE_RPC_CALL_TIMEOUT_MS);
    RABBITMQ_CONNECTION_FACTORY.setHandshakeTimeout(VALUE_HANDSHAKE_CONNECTION_TIMEOUT_MS);

    ExecutorService shutdownExecutor = Executors.newSingleThreadExecutor();
    RABBITMQ_CONNECTION_FACTORY.setShutdownExecutor(shutdownExecutor);

    RABBITMQ_CONNECTION_FACTORY.setShutdownTimeout(VALUE_SHUTDOWN_TIMEOUT_MS);
    RABBITMQ_CONNECTION_FACTORY.setRequestedHeartbeat(VALUE_REQUESTED_HEART_BEAT);
    RABBITMQ_CONNECTION_FACTORY.setAutomaticRecoveryEnabled(VALUE_AUTOMATIC_RECOVERY);
    RABBITMQ_CONNECTION_FACTORY.setTopologyRecoveryEnabled(VALUE_AUTOMATIC_EXCHANGE_RECOVERY);
    RABBITMQ_CONNECTION_FACTORY.setNetworkRecoveryInterval(VALUE_AUTOMATIC_RECOVERY_NETWORK_DELAY_MS);
    RABBITMQ_CONNECTION_FACTORY.setVirtualHost(this.virtualHost);
    RABBITMQ_CONNECTION_FACTORY.setSocketConfigurator(new DefaultSocketConfigurator() {
        @Override
        public void configure(Socket socket) throws IOException {
            socket.setTcpNoDelay(VALUE_DONT_USE_NAGLE);
            socket.setReceiveBufferSize(VALUE_SET_WRITE_BUFFER_SIZE);
            socket.setSendBufferSize(VALUE_SET_SEND_BUFFER_SIZE);
            socket.setPerformancePreferences(0, 2, 1);
            socket.setReuseAddress(true);
            socket.setKeepAlive(VALUE_TCP_KEELALIVE);
            socket.setSoLinger(true, 1000);
        }
    });
}
 
开发者ID:LeeKyoungIl,项目名称:illuminati,代码行数:35,代码来源:RabbitmqInfraTemplateImpl.java

示例2: withNioParams

import com.rabbitmq.client.impl.nio.NioParams; //导入依赖的package包/类
/**
 * Support for Java non-blocking IO
 *
 * @param nioParams The NIO mode can be configured through the NioParams class
 */
public ConnectionOptions withNioParams(NioParams nioParams) {
  this.nioParams = nioParams;
  factory.setNioParams(Assert.notNull(nioParams, "nioParams"));
  factory.useNio();
  return this;
}
 
开发者ID:jhalterman,项目名称:lyra,代码行数:12,代码来源:ConnectionOptions.java

示例3: getNioParams

import com.rabbitmq.client.impl.nio.NioParams; //导入依赖的package包/类
public NioParams getNioParams() {
    return nioParams;
}
 
开发者ID:hammock-project,项目名称:hammock,代码行数:4,代码来源:RabbitMQConfiguration.java

示例4: getNioParams

import com.rabbitmq.client.impl.nio.NioParams; //导入依赖的package包/类
/**
 * Return NioParams object.
 * @see #withNioParams(NioParams)
 * @see #withNio()
 */
public NioParams getNioParams() {
  return nioParams;
}
 
开发者ID:jhalterman,项目名称:lyra,代码行数:9,代码来源:ConnectionOptions.java


注:本文中的com.rabbitmq.client.impl.nio.NioParams类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。