Search in sources :

Example 21 with NettyChannelBuilder

use of org.apache.beam.vendor.grpc.v1p43p2.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();
}
Also used : NettyChannelBuilder(org.apache.beam.vendor.grpc.v1p43p2.io.grpc.netty.NettyChannelBuilder)

Aggregations

NettyChannelBuilder (io.grpc.netty.NettyChannelBuilder)20 InternalNettyChannelBuilder (io.grpc.netty.InternalNettyChannelBuilder)6 InetSocketAddress (java.net.InetSocketAddress)4 ByteString (com.google.protobuf.ByteString)3 ManagedChannel (io.grpc.ManagedChannel)3 Metadata (io.grpc.Metadata)3 LocalAddress (io.netty.channel.local.LocalAddress)3 SslContextBuilder (io.netty.handler.ssl.SslContextBuilder)3 CallOptions (io.grpc.CallOptions)2 Channel (io.grpc.Channel)2 ClientCall (io.grpc.ClientCall)2 ClientInterceptor (io.grpc.ClientInterceptor)2 ForwardingClientCall (io.grpc.ForwardingClientCall)2 ForwardingClientCallListener (io.grpc.ForwardingClientCallListener)2 MethodDescriptor (io.grpc.MethodDescriptor)2 Listener (io.grpc.ServerCall.Listener)2 NettyServerBuilder (io.grpc.netty.NettyServerBuilder)2 NioEventLoopGroup (io.netty.channel.nio.NioEventLoopGroup)2 SslContext (io.netty.handler.ssl.SslContext)2 DefaultThreadFactory (io.netty.util.concurrent.DefaultThreadFactory)2