channel
Builds a ManagedChannel using either a Netty transport or an in-process transport.
When inProcessServerName is non-empty, an in-process channel is created, ignoring hostName, port and tlsContext. The retry and authority options apply to both transports.
A Netty channel uses TLS unless tlsContext says otherwise. Without a tlsContext (null), it verifies the server against the JVM default trust store, as grpc-java's own NettyChannelBuilder does; before 6.0.0 it defaulted to plaintext. A plaintext channel to a host other than localhost or a loopback IP address logs a WARN, since its RPCs and metadata, credentials included, cross the network unencrypted.
Return
the built ManagedChannel
Parameters
the target server hostname (Netty transport only)
the target server port (Netty transport only)
whether gRPC retry is enabled on the channel. true (the default) matches grpc-java's own default: RPCs get transparent retries (e.g. on a refused stream during a server restart), and any retry policy in the channel's service config applies. false calls disableRetry(), which turns off transparent retries as well. Configured retries need a retry policy, supplied in block through defaultServiceConfig(...); this flag alone does not add one.
the maximum number of retry attempts per RPC; a negative value leaves grpc's own default in place
the TLS configuration for a Netty channel. Omitted or null, the channel uses TLS and trusts the servers the JVM default trust store trusts. Pass a context from TlsUtils.buildClientTlsContext to trust a private CA or present a client certificate, or PLAINTEXT_CONTEXT (or any TlsContext without an sslContext) for a plaintext channel
overrides the authority used for TLS hostname verification
if non-empty, creates an in-process channel with this name
a configuration block applied to the channel builder before building