Interface GrpcClient
- All Known Subinterfaces:
GrpcIoClient
public interface GrpcClient
A gRPC client for Vert.x
Unlike traditional gRPC clients, this client does not rely on a generated RPC interface to interact with the service.
Instead, you can interact with the service with a request/response interfaces and gRPC messages, very much like a traditional client.
The client handles only the gRPC protocol and does not encode/decode protobuf messages.
-
Method Summary
Modifier and TypeMethodDescriptionstatic GrpcClientBuilder<GrpcClient> Provide a builder forGrpcClient, it can be used to configure advanced client settings like a load balancer or an address resolver.static GrpcClientCreate a client.static GrpcClientclient(Vertx vertx, HttpClient client) Create a client wrapping an existingHttpClient.static GrpcClientclient(Vertx vertx, HttpClientOptions options) Create a client with the specifiedoptions.static GrpcClientclient(Vertx vertx, ClientSSLOptions sslOptions) Create a client with the specifiedsslOptions.static GrpcClientclient(Vertx vertx, GrpcClientOptions options) Create a client.static GrpcClientclient(Vertx vertx, GrpcClientOptions grpcOptions, HttpClientOptions httpOptions) Create a client with the specifiedoptions.static GrpcClientclient(Vertx vertx, GrpcClientOptions grpcOptions, ClientSSLOptions sslOptions) Create a client with the specifiedsslOptions.close()Close this client.request()Likerequest(Address)with the default remote server.Connect to the remoteserverand create a request for any hosted gRPC service.<Req,Resp> Future <GrpcClientRequest<Req, Resp>> request(Address server, ServiceMethod<Resp, Req> method) Connect to the remoteserverand create a request for any hosted gRPC service.<Req,Resp> Future <GrpcClientRequest<Req, Resp>> request(ServiceMethod<Resp, Req> method) Likerequest(Address, ServiceMethod)with the default remote server.
-
Method Details
-
builder
Provide a builder forGrpcClient, it can be used to configure advanced client settings like a load balancer or an address resolver.Example usage:
GrpcClient client = GrpcClient.builder(vertx).with(options)...build() -
client
Create a client.- Parameters:
vertx- the vertx instance- Returns:
- the created client
-
client
Create a client.- Parameters:
vertx- the vertx instance- Returns:
- the created client
-
client
Create a client with the specifiedsslOptions.- Parameters:
vertx- the vertx instancegrpcOptions- the http client optionssslOptions- the http client options- Returns:
- the created client
-
client
Create a client with the specifiedsslOptions.- Parameters:
vertx- the vertx instancesslOptions- the http client options- Returns:
- the created client
-
client
Create a client with the specifiedoptions.- Parameters:
vertx- the vertx instancegrpcOptions- the http client optionshttpOptions- the http client options- Returns:
- the created client
-
client
Create a client with the specifiedoptions.- Parameters:
vertx- the vertx instanceoptions- the http client options- Returns:
- the created client
-
client
Create a client wrapping an existingHttpClient.- Parameters:
vertx- the vertx instanceclient- the http client instance- Returns:
- the created client
-
request
Connect to the remoteserverand create a request for any hosted gRPC service.- Parameters:
server- the server hosting the service- Returns:
- a future request
-
request
Future<GrpcClientRequest<Buffer,Buffer>> request()Likerequest(Address)with the default remote server. -
request
<Req,Resp> Future<GrpcClientRequest<Req,Resp>> request(Address server, ServiceMethod<Resp, Req> method) Connect to the remoteserverand create a request for any hosted gRPC service.- Parameters:
server- the server hosting the servicemethod- the grpc method- Returns:
- a future request
-
request
Likerequest(Address, ServiceMethod)with the default remote server. -
close
-