@Override
protected RxClient<I, O> createRxClient(Server server) {
ClientBuilder<I, O> builder = RxNetty.newTcpClientBuilder(server.getHost(), server.getPort());
if (pipelineConfigurator != null) {
builder.pipelineConfigurator(pipelineConfigurator);
}
Integer connectTimeout = getProperty(IClientConfigKey.Keys.ConnectTimeout, null, DefaultClientConfigImpl.DEFAULT_CONNECT_TIMEOUT);
builder.channelOption(ChannelOption.CONNECT_TIMEOUT_MILLIS, connectTimeout);
if (isPoolEnabled()) {
builder.withConnectionPoolLimitStrategy(poolStrategy)
.withIdleConnectionsTimeoutMillis(idleConnectionEvictionMills)
.withPoolIdleCleanupScheduler(poolCleanerScheduler);
} else {
builder.withNoConnectionPooling();
}
RxClient<I, O> client = builder.build();
return client;
}
LoadBalancingTcpClient.java 文件源码
java
阅读 59
收藏 0
点赞 0
评论 0
项目:ribbon
作者:
评论列表
文章目录