public interface GrpcServer extends Handler<HttpServerRequest>
The server can be used as a HttpServer handler or mounted as a Vert.x Web handler.
Unlike traditional gRPC servers, this server 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 server exposes 2 levels of handlers
handler: GrpcServerRequest/GrpcServerResponse with Protobuf message that handles any method call in a generic wayhandler: GrpcServerRequest/GrpcServerRequest with gRPC messages that handles specific service method calls| Modifier and Type | Method and Description |
|---|---|
GrpcServer |
callHandler(Handler<GrpcServerRequest<Buffer,Buffer>> handler)
Set a call handler that handles any call made to the server.
|
<Req,Resp> GrpcServer |
callHandler(io.grpc.MethodDescriptor<Req,Resp> methodDesc,
Handler<GrpcServerRequest<Req,Resp>> handler)
Deprecated.
|
<Req,Resp> GrpcServer |
callHandler(ServiceMethod<Req,Resp> serviceMethod,
Handler<GrpcServerRequest<Req,Resp>> handler)
Set a service method call handler that handles any call made to the server for the
fullMethodName service method. |
static GrpcServer |
server(Vertx vertx)
Create a blank gRPC server
|
static GrpcServer |
server(Vertx vertx,
GrpcServerOptions options)
Create a blank gRPC server
|
static GrpcServer server(Vertx vertx)
vertx - the vertx instancestatic GrpcServer server(Vertx vertx, GrpcServerOptions options)
vertx - the vertx instanceoptions - the server optionsGrpcServer callHandler(Handler<GrpcServerRequest<Buffer,Buffer>> handler)
handler - the service method call handler<Req,Resp> GrpcServer callHandler(ServiceMethod<Req,Resp> serviceMethod, Handler<GrpcServerRequest<Req,Resp>> handler)
fullMethodName service method.handler - the service method call handlerserviceMethod - the service method@Deprecated <Req,Resp> GrpcServer callHandler(io.grpc.MethodDescriptor<Req,Resp> methodDesc, Handler<GrpcServerRequest<Req,Resp>> handler)
GrpcIoServer.callHandler(MethodDescriptor, Handler)Copyright © 2025 Eclipse. All rights reserved.