public final class GrpcClients
extends Object
| Modifier and Type | Method and Description |
|---|---|
static GrpcClientBuilder<HostAndPort,InetSocketAddress> |
forAddress(HostAndPort address)
Creates a
GrpcClientBuilder for an address with default LoadBalancer and DNS
ServiceDiscoverer. |
static <U,R> GrpcClientBuilder<U,R> |
forAddress(ServiceDiscoverer<U,R,ServiceDiscovererEvent<R>> serviceDiscoverer,
U address)
Creates a
GrpcClientBuilder for a custom address type with default LoadBalancer and user
provided ServiceDiscoverer. |
static GrpcClientBuilder<HostAndPort,InetSocketAddress> |
forAddress(String host,
int port)
Creates a
GrpcClientBuilder for an address with default LoadBalancer and DNS
ServiceDiscoverer. |
static GrpcClientBuilder<HostAndPort,InetSocketAddress> |
forResolvedAddress(HostAndPort address)
Creates a
GrpcClientBuilder for an address with default LoadBalancer. |
static GrpcClientBuilder<InetSocketAddress,InetSocketAddress> |
forResolvedAddress(InetSocketAddress address)
Creates a
GrpcClientBuilder for an address with default LoadBalancer. |
static GrpcClientBuilder<HostAndPort,InetSocketAddress> |
forResolvedAddress(String host,
int port)
Creates a
GrpcClientBuilder for a resolved address with default LoadBalancer. |
static <T extends SocketAddress> |
forResolvedAddress(T address)
Creates a
GrpcClientBuilder for an address with default LoadBalancer. |
static GrpcClientBuilder<String,InetSocketAddress> |
forServiceAddress(String serviceName)
Creates a
GrpcClientBuilder for the passed serviceName with default LoadBalancer and a
DNS ServiceDiscoverer using SRV record lookups. |
public static GrpcClientBuilder<HostAndPort,InetSocketAddress> forAddress(String host,
int port)
GrpcClientBuilder for an address with default LoadBalancer and DNS
ServiceDiscoverer.host - host to connect to, resolved by default using a DNS ServiceDiscoverer.port - port to connect topublic static GrpcClientBuilder<HostAndPort,InetSocketAddress> forAddress(HostAndPort address)
GrpcClientBuilder for an address with default LoadBalancer and DNS
ServiceDiscoverer.address - the UnresolvedAddress to connect to, resolved by default using a DNS
ServiceDiscoverer.public static GrpcClientBuilder<String,InetSocketAddress> forServiceAddress(String serviceName)
GrpcClientBuilder for the passed serviceName with default LoadBalancer and a
DNS ServiceDiscoverer using SRV record lookups.serviceName - the service name to query via SRV DNS.public static GrpcClientBuilder<HostAndPort,InetSocketAddress> forResolvedAddress(String host,
int port)
GrpcClientBuilder for a resolved address with default LoadBalancer.host - resolved host address to connect to.port - port to connect topublic static GrpcClientBuilder<HostAndPort,InetSocketAddress> forResolvedAddress(HostAndPort address)
GrpcClientBuilder for an address with default LoadBalancer.address - the ResolvedAddress to connect to.public static GrpcClientBuilder<InetSocketAddress,InetSocketAddress> forResolvedAddress(InetSocketAddress address)
GrpcClientBuilder for an address with default LoadBalancer.address - the InetSocketAddress to connect to.public static <T extends SocketAddress> GrpcClientBuilder<T,T> forResolvedAddress(T address)
GrpcClientBuilder for an address with default LoadBalancer.T - The type of SocketAddress.address - the ResolvedAddress to connect. This address will also be used for the
HttpHeaderNames.HOST.
Use SingleAddressHttpClientBuilder.unresolvedAddressToHost(Function)
via GrpcClientBuilder.initializeHttp(GrpcClientBuilder.HttpInitializer)
if you want to override that value or
SingleAddressHttpClientBuilder.hostHeaderFallback(boolean)
if you want to disable this behavior.public static <U,R> GrpcClientBuilder<U,R> forAddress(ServiceDiscoverer<U,R,ServiceDiscovererEvent<R>> serviceDiscoverer,
U address)
GrpcClientBuilder for a custom address type with default LoadBalancer and user
provided ServiceDiscoverer.U - the type of address before resolution (unresolved address)R - the type of address after resolution (resolved address)serviceDiscoverer - The ServiceDiscoverer to resolve addresses of remote servers to connect to.
The lifecycle of the provided ServiceDiscoverer should be managed by the caller.address - the UnresolvedAddress to connect to resolved using the provided serviceDiscoverer.