io.vertx.grpc.server

## Interface GrpcServer

- All Superinterfaces:
    Handler<HttpServerRequest>
  All Known Subinterfaces:
    GrpcIoServer

      public interface GrpcServer
      extends Handler<HttpServerRequest>

  A gRPC server based on Vert.x HTTP server.

  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

  - a Protobuf message `handler`: `GrpcServerRequest`/`GrpcServerResponse` with Protobuf message that handles any method call in a generic way
  - a gRPC message `handler`: `GrpcServerRequest`/`GrpcServerRequest` with gRPC messages that handles specific service method calls

- - ### Method Summary

    All Methods Static Methods Instance Methods Abstract Methods Default Methods Deprecated Methods
    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. use `GrpcIoServer.callHandler(MethodDescriptor, Handler)`
    `<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

    - ### Methods inherited from interface io.vertx.core.Handler

      `handle`

- - ### Method Detail

    - #### server

          static GrpcServer server(Vertx vertx)

      Create a blank gRPC server
      Parameters:
        `vertx` - the vertx instance
      Returns:
        the created server

    - #### server

          static GrpcServer server(Vertx vertx,
                                   GrpcServerOptions options)

      Create a blank gRPC server
      Parameters:
        `vertx` - the vertx instance
        `options` - the server options
      Returns:
        the created server

    - #### callHandler

          GrpcServer callHandler(Handler<GrpcServerRequest<Buffer,Buffer>> handler)

      Set a call handler that handles any call made to the server.
      Parameters:
        `handler` - the service method call handler
      Returns:
        a reference to this, so the API can be used fluently

    - #### callHandler

          <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.
      Parameters:
        `handler` - the service method call handler
        `serviceMethod` - the service method
      Returns:
        a reference to this, so the API can be used fluently

    - #### callHandler

          @Deprecated
          <Req,Resp> GrpcServer callHandler(io.grpc.MethodDescriptor<Req,Resp> methodDesc,
                                                        Handler<GrpcServerRequest<Req,Resp>> handler)

      Deprecated. use `GrpcIoServer.callHandler(MethodDescriptor, Handler)`

Copyright © 2025 Eclipse. All rights reserved.