ChannelPool channelPool = poolMap.get(new RequestKey(requestURI)); Future<Channel> channelFuture = channelPool.acquire(); channelFuture.addListener(future -> {
@Override protected ChannelPool newPool(RequestKey key) { Bootstrap newBootstrap = bootstrap.clone(group); newBootstrap.remoteAddress(key.getRemoteAddress()); AbstractChannelPoolHandler channelPoolHandler = newPoolHandler(key); return new FixedChannelPool( newBootstrap, channelPoolHandler, ChannelHealthChecker.ACTIVE, FixedChannelPool.AcquireTimeoutAction.FAIL, connectionPoolConfiguration.getAcquireTimeout().map(Duration::toMillis).orElse(-1L), maxConnections, connectionPoolConfiguration.getMaxPendingAcquires() ); } };
ChannelPool channelPool = poolMap.get(new RequestKey(requestURI)); Future<Channel> channelFuture = channelPool.acquire(); channelFuture.addListener(future -> {
ChannelPool channelPool = poolMap.get(new RequestKey(requestURI)); Future<Channel> channelFuture = channelPool.acquire(); channelFuture.addListener(future -> {
@Override protected ChannelPool newPool(RequestKey key) { Bootstrap newBootstrap = bootstrap.clone(group); newBootstrap.remoteAddress(key.getRemoteAddress()); AbstractChannelPoolHandler channelPoolHandler = newPoolHandler(key); return new FixedChannelPool( newBootstrap, channelPoolHandler, ChannelHealthChecker.ACTIVE, FixedChannelPool.AcquireTimeoutAction.FAIL, connectionPoolConfiguration.getAcquireTimeout().map(Duration::toMillis).orElse(-1L), maxConnections, connectionPoolConfiguration.getMaxPendingAcquires() ); } };
@Override protected ChannelPool newPool(RequestKey key) { Bootstrap newBootstrap = bootstrap.clone(group); newBootstrap.remoteAddress(key.getRemoteAddress()); AbstractChannelPoolHandler channelPoolHandler = newPoolHandler(key); return new FixedChannelPool( newBootstrap, channelPoolHandler, ChannelHealthChecker.ACTIVE, FixedChannelPool.AcquireTimeoutAction.FAIL, connectionPoolConfiguration.getAcquireTimeout().map(Duration::toMillis).orElse(-1L), maxConnections, connectionPoolConfiguration.getMaxPendingAcquires() ); } };
@Override protected ChannelPool newPool(RequestKey key) { Bootstrap newBootstrap = bootstrap.clone(group); newBootstrap.remoteAddress(key.getRemoteAddress()); AbstractChannelPoolHandler channelPoolHandler = newPoolHandler(key); return new SimpleChannelPool( newBootstrap, channelPoolHandler ); } };
@Override protected ChannelPool newPool(RequestKey key) { Bootstrap newBootstrap = bootstrap.clone(group); newBootstrap.remoteAddress(key.getRemoteAddress()); AbstractChannelPoolHandler channelPoolHandler = newPoolHandler(key); return new SimpleChannelPool( newBootstrap, channelPoolHandler ); } };
@Override protected ChannelPool newPool(RequestKey key) { Bootstrap newBootstrap = bootstrap.clone(group); newBootstrap.remoteAddress(key.getRemoteAddress()); AbstractChannelPoolHandler channelPoolHandler = newPoolHandler(key); return new SimpleChannelPool( newBootstrap, channelPoolHandler ); } };