Top Description Constructors Methods
io.grpc

public abstract Class ForwardingChannelBuilder2<T extends io.grpc.ManagedChannelBuilder<T>>

extends ManagedChannelBuilder<T extends ManagedChannelBuilder<T>>
Class Inheritance
Known Direct Subclasses
io.grpc.ForwardingChannelBuilder
Type Parameters
<T>
The type of the subclass extending this abstract class.
Imports
com.google.common.base.MoreObjects, com.google.errorprone.annotations.DoNotCall, java.util.List, .Map, java.util.concurrent.Executor, .TimeUnit, javax.annotation.Nullable

A ManagedChannelBuilder that delegates all its builder methods to another builder by default.

Always choose this over ForwardingChannelBuilder, because ForwardingChannelBuilder2 is ABI-safe.

Since
1.59.0

Constructor Summary

AccessConstructor and Description
protected
ForwardingChannelBuilder2()

The default constructor.

Method Summary

Modifier and TypeMethod and Description
public ManagedChannel
build()

Implements abstract io.grpc.ManagedChannelBuilder.build.

Returns the ManagedChannel built by the delegate by default.
public T
compressorRegistry(CompressorRegistry registry)

Implements abstract io.grpc.ManagedChannelBuilder.compressorRegistry.

Set the compression registry for use in the channel.
public T
decompressorRegistry(DecompressorRegistry registry)

Implements abstract io.grpc.ManagedChannelBuilder.decompressorRegistry.

Set the decompression registry for use in the channel.
public T
defaultLoadBalancingPolicy(String policy)

Overrides io.grpc.ManagedChannelBuilder.defaultLoadBalancingPolicy.

Sets the default load-balancing policy that will be used if the service config doesn't specify one.
public T
defaultServiceConfig(Map<String, ?> serviceConfig)

Overrides io.grpc.ManagedChannelBuilder.defaultServiceConfig.

Provides a service config to the channel.
protected abstract ManagedChannelBuilder<?>
delegate()

Returns the delegated ManagedChannelBuilder.

public T
directExecutor()

Implements abstract io.grpc.ManagedChannelBuilder.directExecutor.

Execute application code directly in the transport thread.
public T
disableRetry()

Overrides io.grpc.ManagedChannelBuilder.disableRetry.

Disables the retry and hedging subsystem provided by the gRPC library.
public T
disableServiceConfigLookUp()

Overrides io.grpc.ManagedChannelBuilder.disableServiceConfigLookUp.

Disables service config look-up from the naming system, which is enabled by default.
public T
enableFullStreamDecompression()

Overrides io.grpc.ManagedChannelBuilder.enableFullStreamDecompression.

Enables full-stream decompression of inbound streams.
public T
enableRetry()

Overrides io.grpc.ManagedChannelBuilder.enableRetry.

Enables the retry and hedging subsystem which will use per-method configuration.
public T
executor(Executor executor)

Implements abstract io.grpc.ManagedChannelBuilder.executor.

Provides a custom executor.
public static ManagedChannelBuilder<?>
forAddress(String name, int port)

Hides io.grpc.ManagedChannelBuilder.forAddress.

This method serves to force subclasses to "hide" this static factory.
public static ManagedChannelBuilder<?>
forTarget(String target)

Hides io.grpc.ManagedChannelBuilder.forTarget.

This method serves to force subclasses to "hide" this static factory.
public T
idleTimeout(long value, TimeUnit unit)

Implements abstract io.grpc.ManagedChannelBuilder.idleTimeout.

Set the duration without ongoing RPCs before going to idle mode.
public T
intercept(List<ClientInterceptor> interceptors)

Implements abstract io.grpc.ManagedChannelBuilder.intercept.

Adds interceptors that will be called before the channel performs its real work.
public T
intercept(ClientInterceptor... interceptors)

Implements abstract io.grpc.ManagedChannelBuilder.intercept.

Adds interceptors that will be called before the channel performs its real work.
public T
keepAliveTime(long keepAliveTime, TimeUnit timeUnit)

Overrides io.grpc.ManagedChannelBuilder.keepAliveTime.

Sets the time without read activity before sending a keepalive ping.
public T
keepAliveTimeout(long keepAliveTimeout, TimeUnit timeUnit)

Overrides io.grpc.ManagedChannelBuilder.keepAliveTimeout.

Sets the time waiting for read activity after sending a keepalive ping.
public T
keepAliveWithoutCalls(boolean enable)

Overrides io.grpc.ManagedChannelBuilder.keepAliveWithoutCalls.

Sets whether keepalive will be performed when there are no outstanding RPC on a connection.
public T
maxHedgedAttempts(int maxHedgedAttempts)

Overrides io.grpc.ManagedChannelBuilder.maxHedgedAttempts.

Sets the maximum number of hedged attempts that may be configured by the service config.
public T
maxInboundMessageSize(int
the maximum number of bytes a single message can be.
max
)

Overrides io.grpc.ManagedChannelBuilder.maxInboundMessageSize.

Sets the maximum message size allowed to be received on the channel.
public T
maxInboundMetadataSize(int
the maximum size of received metadata
max
)

Overrides io.grpc.ManagedChannelBuilder.maxInboundMetadataSize.

Sets the maximum size of metadata allowed to be received.
public T
maxRetryAttempts(int maxRetryAttempts)

Overrides io.grpc.ManagedChannelBuilder.maxRetryAttempts.

Sets the maximum number of retry attempts that may be configured by the service config.
public T
maxTraceEvents(int maxTraceEvents)

Overrides io.grpc.ManagedChannelBuilder.maxTraceEvents.

Sets the maximum number of channel trace events to keep in the tracer for each channel or subchannel.
public T
nameResolverFactory(NameResolver.Factory resolverFactory)

Implements abstract io.grpc.ManagedChannelBuilder.nameResolverFactory.

Deprecated
Provides a custom NameResolver.Factory for the channel.
public T
offloadExecutor(Executor executor)

Overrides io.grpc.ManagedChannelBuilder.offloadExecutor.

Provides a custom executor that will be used for operations that block or are expensive, to avoid blocking asynchronous code paths.
public T
overrideAuthority(String authority)

Implements abstract io.grpc.ManagedChannelBuilder.overrideAuthority.

Overrides the authority used with TLS and HTTP virtual hosting.
public T
perRpcBufferLimit(long bytes)

Overrides io.grpc.ManagedChannelBuilder.perRpcBufferLimit.

Sets the per RPC buffer limit in bytes used for retry.
public T
proxyDetector(ProxyDetector proxyDetector)

Overrides io.grpc.ManagedChannelBuilder.proxyDetector.

Sets the proxy detector to be used in addresses name resolution.
public T
retryBufferSize(long bytes)

Overrides io.grpc.ManagedChannelBuilder.retryBufferSize.

Sets the retry buffer size in bytes.
public T
setBinaryLog(BinaryLog
the object to provide logging.
binaryLog
)

Overrides io.grpc.ManagedChannelBuilder.setBinaryLog.

Sets the BinaryLog object that this channel should log to.
private T
thisT()

Hides io.grpc.ManagedChannelBuilder.thisT.

Returns the correctly typed version of the builder.
public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.
public T
usePlaintext()

Overrides io.grpc.ManagedChannelBuilder.usePlaintext.

Use of a plaintext connection to the server.
public T
userAgent(String userAgent)

Implements abstract io.grpc.ManagedChannelBuilder.userAgent.

Provides a custom User-Agent for the application.
public T

Constructor Detail

ForwardingChannelBuilder2back to summary
protected ForwardingChannelBuilder2()

The default constructor.

Method Detail

buildback to summary
public ManagedChannel build()

Implements abstract io.grpc.ManagedChannelBuilder.build.

Returns the ManagedChannel built by the delegate by default. Overriding method can return different value.

Annotations
@Override
compressorRegistryback to summary
public T compressorRegistry(CompressorRegistry registry)

Implements abstract io.grpc.ManagedChannelBuilder.compressorRegistry.

Doc from io.grpc.ManagedChannelBuilder.compressorRegistry.

Set the compression registry for use in the channel. This is an advanced API call and shouldn't be used unless you are using custom message encoding. The default supported compressors are in CompressorRegistry#getDefaultInstance.

Returns:T

this

Annotations
@Override
decompressorRegistryback to summary
public T decompressorRegistry(DecompressorRegistry registry)

Implements abstract io.grpc.ManagedChannelBuilder.decompressorRegistry.

Doc from io.grpc.ManagedChannelBuilder.decompressorRegistry.

Set the decompression registry for use in the channel. This is an advanced API call and shouldn't be used unless you are using custom message encoding. The default supported decompressors are in DecompressorRegistry#getDefaultInstance.

Returns:T

this

Annotations
@Override
defaultLoadBalancingPolicyback to summary
public T defaultLoadBalancingPolicy(String policy)

Overrides io.grpc.ManagedChannelBuilder.defaultLoadBalancingPolicy.

Doc from io.grpc.ManagedChannelBuilder.defaultLoadBalancingPolicy.

Sets the default load-balancing policy that will be used if the service config doesn't specify one. If not set, the default will be the "pick_first" policy.

Policy implementations are looked up in the default LoadBalancerRegistry.

This method is implemented by all stock channel builders that are shipped with gRPC, but may not be implemented by custom channel builders, in which case this method will throw.

Returns:T

this

Annotations
@Override
defaultServiceConfigback to summary
public T defaultServiceConfig(Map<String, ?> serviceConfig)

Overrides io.grpc.ManagedChannelBuilder.defaultServiceConfig.

Doc from io.grpc.ManagedChannelBuilder.defaultServiceConfig.

Provides a service config to the channel. The channel will use the default service config when the name resolver provides no service config or if the channel disables lookup service config from name resolver (see disableServiceConfigLookUp()). The argument serviceConfig is a nested map representing a Json object in the most natural way:

Json entryJava Type
objectMap
arrayList
stringString
numberDouble
booleanBoolean
nullnull

If null is passed, then there will be no default service config.

Your preferred JSON parser may not produce results in the format expected. For such cases, you can convert its output. For example, if your parser produces Integers and other Numbers in addition to Double:

@SuppressWarnings("unchecked")
private static Object convertNumbers(Object o) {
  if (o instanceof Map) {
    ((Map) o).replaceAll((k,v) -> convertNumbers(v));
  } else if (o instanceof List) {
    ((List) o).replaceAll(YourClass::convertNumbers);
  } else if (o instanceof Number && !(o instanceof Double)) {
    o = ((Number) o).doubleValue();
  }
  return o;
}
Returns:T

this

Annotations
@Override
delegateback to summary
protected abstract ManagedChannelBuilder<?> delegate()

Returns the delegated ManagedChannelBuilder.

directExecutorback to summary
public T directExecutor()

Implements abstract io.grpc.ManagedChannelBuilder.directExecutor.

Doc from io.grpc.ManagedChannelBuilder.directExecutor.

Execute application code directly in the transport thread.

Depending on the underlying transport, using a direct executor may lead to substantial performance improvements. However, it also requires the application to not block under any circumstances.

Calling this method is semantically equivalent to calling executor(Executor) and passing in a direct executor. However, this is the preferred way as it may allow the transport to perform special optimizations.

Returns:T

this

Annotations
@Override
disableRetryback to summary
public T disableRetry()

Overrides io.grpc.ManagedChannelBuilder.disableRetry.

Doc from io.grpc.ManagedChannelBuilder.disableRetry.

Disables the retry and hedging subsystem provided by the gRPC library. This is designed for the case when users have their own retry implementation and want to avoid their own retry taking place simultaneously with the gRPC library layer retry.

Returns:T

this

Annotations
@Override
disableServiceConfigLookUpback to summary
public T disableServiceConfigLookUp()

Overrides io.grpc.ManagedChannelBuilder.disableServiceConfigLookUp.

Doc from io.grpc.ManagedChannelBuilder.disableServiceConfigLookUp.

Disables service config look-up from the naming system, which is enabled by default.

Returns:T

this

Annotations
@Override
enableFullStreamDecompressionback to summary
public T enableFullStreamDecompression()

Overrides io.grpc.ManagedChannelBuilder.enableFullStreamDecompression.

Doc from io.grpc.ManagedChannelBuilder.enableFullStreamDecompression.

Enables full-stream decompression of inbound streams. This will cause the channel's outbound headers to advertise support for GZIP compressed streams, and gRPC servers which support the feature may respond with a GZIP compressed stream.

EXPERIMENTAL: This method is here to enable an experimental feature, and may be changed or removed once the feature is stable.

Annotations
@Override
enableRetryback to summary
public T enableRetry()

Overrides io.grpc.ManagedChannelBuilder.enableRetry.

Doc from io.grpc.ManagedChannelBuilder.enableRetry.

Enables the retry and hedging subsystem which will use per-method configuration. If a method is unconfigured, it will be limited to transparent retries, which are safe for non-idempotent RPCs. Service config is ideally provided by the name resolver, but may also be specified via defaultServiceConfig.

Returns:T

this

Annotations
@Override
executorback to summary
public T executor(Executor executor)

Implements abstract io.grpc.ManagedChannelBuilder.executor.

Doc from io.grpc.ManagedChannelBuilder.executor.

Provides a custom executor.

It's an optional parameter. If the user has not provided an executor when the channel is built, the builder will use a static cached thread pool.

The channel won't take ownership of the given executor. It's caller's responsibility to shut down the executor when it's desired.

Returns:T

this

Annotations
@Override
forAddressback to summary
public static ManagedChannelBuilder<?> forAddress(String name, int port)

Hides io.grpc.ManagedChannelBuilder.forAddress.

This method serves to force subclasses to "hide" this static factory.

Annotations
@DoNotCall:Unsupported
forTargetback to summary
public static ManagedChannelBuilder<?> forTarget(String target)

Hides io.grpc.ManagedChannelBuilder.forTarget.

This method serves to force subclasses to "hide" this static factory.

Annotations
@DoNotCall:Unsupported
idleTimeoutback to summary
public T idleTimeout(long value, TimeUnit unit)

Implements abstract io.grpc.ManagedChannelBuilder.idleTimeout.

Doc from io.grpc.ManagedChannelBuilder.idleTimeout.

Set the duration without ongoing RPCs before going to idle mode.

In idle mode the channel shuts down all connections, the NameResolver and the LoadBalancer. A new RPC would take the channel out of idle mode. A channel starts in idle mode. Defaults to 30 minutes.

This is an advisory option. Do not rely on any specific behavior related to this option.

Returns:T

this

Annotations
@Override
interceptback to summary
public T intercept(List<ClientInterceptor> interceptors)

Implements abstract io.grpc.ManagedChannelBuilder.intercept.

Doc from io.grpc.ManagedChannelBuilder.intercept.

Adds interceptors that will be called before the channel performs its real work. This is functionally equivalent to using ClientInterceptors#intercept(Channel, List), but while still having access to the original ManagedChannel. Interceptors run in the reverse order in which they are added, just as with consecutive calls to ClientInterceptors.intercept().

Returns:T

this

Annotations
@Override
interceptback to summary
public T intercept(ClientInterceptor... interceptors)

Implements abstract io.grpc.ManagedChannelBuilder.intercept.

Doc from io.grpc.ManagedChannelBuilder.intercept.

Adds interceptors that will be called before the channel performs its real work. This is functionally equivalent to using ClientInterceptors#intercept(Channel, ClientInterceptor...), but while still having access to the original ManagedChannel. Interceptors run in the reverse order in which they are added, just as with consecutive calls to ClientInterceptors.intercept().

Returns:T

this

Annotations
@Override
keepAliveTimeback to summary
public T keepAliveTime(long keepAliveTime, TimeUnit timeUnit)

Overrides io.grpc.ManagedChannelBuilder.keepAliveTime.

Doc from io.grpc.ManagedChannelBuilder.keepAliveTime.

Sets the time without read activity before sending a keepalive ping. An unreasonably small value might be increased, and Long.MAX_VALUE nano seconds or an unreasonably large value will disable keepalive. Defaults to infinite.

Clients must receive permission from the service owner before enabling this option. Keepalives can increase the load on services and are commonly "invisible" making it hard to notice when they are causing excessive load. Clients are strongly encouraged to use only as small of a value as necessary.

Annotations
@Override
keepAliveTimeoutback to summary
public T keepAliveTimeout(long keepAliveTimeout, TimeUnit timeUnit)

Overrides io.grpc.ManagedChannelBuilder.keepAliveTimeout.

Doc from io.grpc.ManagedChannelBuilder.keepAliveTimeout.

Sets the time waiting for read activity after sending a keepalive ping. If the time expires without any read activity on the connection, the connection is considered dead. An unreasonably small value might be increased. Defaults to 20 seconds.

This value should be at least multiple times the RTT to allow for lost packets.

Annotations
@Override
keepAliveWithoutCallsback to summary
public T keepAliveWithoutCalls(boolean enable)

Overrides io.grpc.ManagedChannelBuilder.keepAliveWithoutCalls.

Doc from io.grpc.ManagedChannelBuilder.keepAliveWithoutCalls.

Sets whether keepalive will be performed when there are no outstanding RPC on a connection. Defaults to false.

Clients must receive permission from the service owner before enabling this option. Keepalives on unused connections can easilly accidentally consume a considerable amount of bandwidth and CPU. idleTimeout() should generally be used instead of this option.

Annotations
@Override
maxHedgedAttemptsback to summary
public T maxHedgedAttempts(int maxHedgedAttempts)

Overrides io.grpc.ManagedChannelBuilder.maxHedgedAttempts.

Doc from io.grpc.ManagedChannelBuilder.maxHedgedAttempts.

Sets the maximum number of hedged attempts that may be configured by the service config. If the service config specifies a larger value it will be reduced to this value.

This method may not work as expected for the current release because retry is not fully implemented yet.

Returns:T

this

Annotations
@Override
maxInboundMessageSizeback to summary
public T maxInboundMessageSize(int max)

Overrides io.grpc.ManagedChannelBuilder.maxInboundMessageSize.

Doc from io.grpc.ManagedChannelBuilder.maxInboundMessageSize.

Sets the maximum message size allowed to be received on the channel. If not called, defaults to 4 MiB. The default provides protection to clients who haven't considered the possibility of receiving large messages while trying to be large enough to not be hit in normal usage.

This method is advisory, and implementations may decide to not enforce this. Currently, the only known transport to not enforce this is InProcessTransport.

Parameters
max:int

the maximum number of bytes a single message can be.

Returns:T

this

Annotations
@Override
maxInboundMetadataSizeback to summary
public T maxInboundMetadataSize(int max)

Overrides io.grpc.ManagedChannelBuilder.maxInboundMetadataSize.

Doc from io.grpc.ManagedChannelBuilder.maxInboundMetadataSize.

Sets the maximum size of metadata allowed to be received. Integer.MAX_VALUE disables the enforcement. The default is implementation-dependent, but is not generally less than 8 KiB and may be unlimited.

This is cumulative size of the metadata. The precise calculation is implementation-dependent, but implementations are encouraged to follow the calculation used for HTTP/2's SETTINGS_MAX_HEADER_LIST_SIZE. It sums the bytes from each entry's key and value, plus 32 bytes of overhead per entry.

Parameters
max:int

the maximum size of received metadata

Returns:T

this

Annotations
@Override
maxRetryAttemptsback to summary
public T maxRetryAttempts(int maxRetryAttempts)

Overrides io.grpc.ManagedChannelBuilder.maxRetryAttempts.

Doc from io.grpc.ManagedChannelBuilder.maxRetryAttempts.

Sets the maximum number of retry attempts that may be configured by the service config. If the service config specifies a larger value it will be reduced to this value. Setting this number to zero is not effectively the same as disableRetry() because the former does not disable transparent retry.

This method may not work as expected for the current release because retry is not fully implemented yet.

Returns:T

this

Annotations
@Override
maxTraceEventsback to summary
public T maxTraceEvents(int maxTraceEvents)

Overrides io.grpc.ManagedChannelBuilder.maxTraceEvents.

Doc from io.grpc.ManagedChannelBuilder.maxTraceEvents.

Sets the maximum number of channel trace events to keep in the tracer for each channel or subchannel. If set to 0, channel tracing is effectively disabled.

Returns:T

this

Annotations
@Override
nameResolverFactoryback to summary
public T nameResolverFactory(NameResolver.Factory resolverFactory)

Implements abstract io.grpc.ManagedChannelBuilder.nameResolverFactory.

Doc from io.grpc.ManagedChannelBuilder.nameResolverFactory.

Deprecated

Provides a custom NameResolver.Factory for the channel. If this method is not called, the builder will try the providers registered in the default NameResolverRegistry for the given target.

This method should rarely be used, as name resolvers should provide a NameResolverProvider and users rely on service loading to find implementations in the class path. That allows application's configuration to easily choose the name resolver via the 'target' string passed to ManagedChannelBuilder#forTarget(String).

Returns:T

this

Annotations
@Deprecated
@Override
offloadExecutorback to summary
public T offloadExecutor(Executor executor)

Overrides io.grpc.ManagedChannelBuilder.offloadExecutor.

Doc from io.grpc.ManagedChannelBuilder.offloadExecutor.

Provides a custom executor that will be used for operations that block or are expensive, to avoid blocking asynchronous code paths. For example, DNS queries and OAuth token fetching over HTTP could use this executor.

It's an optional parameter. If the user has not provided an executor when the channel is built, the builder will use a static cached thread pool.

The channel won't take ownership of the given executor. It's caller's responsibility to shut down the executor when it's desired.

Returns:T

this

Annotations
@Override
overrideAuthorityback to summary
public T overrideAuthority(String authority)

Implements abstract io.grpc.ManagedChannelBuilder.overrideAuthority.

Doc from io.grpc.ManagedChannelBuilder.overrideAuthority.

Overrides the authority used with TLS and HTTP virtual hosting. It does not change what host is actually connected to. Is commonly in the form host:port.

If the channel builder overrides authority, any authority override from name resolution result (via EquivalentAddressGroup#ATTR_AUTHORITY_OVERRIDE) will be discarded.

This method is intended for testing, but may safely be used outside of tests as an alternative to DNS overrides.

Returns:T

this

Annotations
@Override
perRpcBufferLimitback to summary
public T perRpcBufferLimit(long bytes)

Overrides io.grpc.ManagedChannelBuilder.perRpcBufferLimit.

Doc from io.grpc.ManagedChannelBuilder.perRpcBufferLimit.

Sets the per RPC buffer limit in bytes used for retry. The RPC is not retriable if its buffer limit is exceeded. The implementation may only estimate the buffer size being used rather than count the exact physical memory allocated. It does not have any effect if retry is disabled by the client.

This method may not work as expected for the current release because retry is not fully implemented yet.

Returns:T

this

Annotations
@Override
proxyDetectorback to summary
public T proxyDetector(ProxyDetector proxyDetector)

Overrides io.grpc.ManagedChannelBuilder.proxyDetector.

Doc from io.grpc.ManagedChannelBuilder.proxyDetector.

Sets the proxy detector to be used in addresses name resolution. If null is passed the default proxy detector will be used. For how proxies work in gRPC, please refer to the documentation on ProxyDetector.

Returns:T

this

Annotations
@Override
retryBufferSizeback to summary
public T retryBufferSize(long bytes)

Overrides io.grpc.ManagedChannelBuilder.retryBufferSize.

Doc from io.grpc.ManagedChannelBuilder.retryBufferSize.

Sets the retry buffer size in bytes. If the buffer limit is exceeded, no RPC could retry at the moment, and in hedging case all hedges but one of the same RPC will cancel. The implementation may only estimate the buffer size being used rather than count the exact physical memory allocated. The method does not have any effect if retry is disabled by the client.

This method may not work as expected for the current release because retry is not fully implemented yet.

Returns:T

this

Annotations
@Override
setBinaryLogback to summary
public T setBinaryLog(BinaryLog binaryLog)

Overrides io.grpc.ManagedChannelBuilder.setBinaryLog.

Doc from io.grpc.ManagedChannelBuilder.setBinaryLog.

Sets the BinaryLog object that this channel should log to. The channel does not take ownership of the object, and users are responsible for calling BinaryLog#close().

Parameters
binaryLog:BinaryLog

the object to provide logging.

Returns:T

this

Annotations
@Override
thisTback to summary
private T thisT()

Hides io.grpc.ManagedChannelBuilder.thisT.

Returns the correctly typed version of the builder.

toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object.

Returns:String

a string representation of the object.

Annotations
@Override
usePlaintextback to summary
public T usePlaintext()

Overrides io.grpc.ManagedChannelBuilder.usePlaintext.

Doc from io.grpc.ManagedChannelBuilder.usePlaintext.

Use of a plaintext connection to the server. By default a secure connection mechanism such as TLS will be used.

Should only be used for testing or for APIs where the use of such API or the data exchanged is not sensitive.

This assumes prior knowledge that the target of this channel is using plaintext. It will not perform HTTP/1.1 upgrades.

Returns:T

this

Annotations
@Override
userAgentback to summary
public T userAgent(String userAgent)

Implements abstract io.grpc.ManagedChannelBuilder.userAgent.

Doc from io.grpc.ManagedChannelBuilder.userAgent.

Provides a custom User-Agent for the application.

It's an optional parameter. The library will provide a user agent independent of this option. If provided, the given agent will prepend the library's user agent information.

Returns:T

this

Annotations
@Override
useTransportSecurityback to summary
public T useTransportSecurity()

Overrides io.grpc.ManagedChannelBuilder.useTransportSecurity.

Doc from io.grpc.ManagedChannelBuilder.useTransportSecurity.

Makes the client use TLS.

Note

this is enabled by default.

It is recommended to use the ChannelCredentials API instead of this method.

Returns:T

this

Annotations
@Override