use of io.grpc.netty.NettyChannelBuilder in project beam by apache.
the class GrpcWindmillServer method remoteChannel.
private Channel remoteChannel(HostAndPort endpoint) throws IOException {
NettyChannelBuilder builder = NettyChannelBuilder.forAddress(endpoint.getHost(), endpoint.getPort());
int timeoutSec = options.getWindmillServiceRpcChannelAliveTimeoutSec();
if (timeoutSec > 0) {
builder = builder.keepAliveTime(timeoutSec, TimeUnit.SECONDS).keepAliveTimeout(timeoutSec, TimeUnit.SECONDS).keepAliveWithoutCalls(true);
}
return builder.flowControlWindow(10 * 1024 * 1024).maxInboundMessageSize(java.lang.Integer.MAX_VALUE).maxInboundMetadataSize(1024 * 1024).negotiationType(NegotiationType.TLS).sslContext(GrpcSslContexts.forClient().ciphers(null).build()).build();
}
Aggregations