io.vertx.reactivex.grpc.server

## Class GrpcServer

- java.lang.Object
- - io.vertx.reactivex.grpc.server.GrpcServer

- All Implemented Interfaces:
    Handler<HttpServerRequest>, io.vertx.lang.rx.RxDelegate
  Direct Known Subclasses:
    GrpcIoServer

      public class GrpcServer
      extends Object
      implements io.vertx.lang.rx.RxDelegate, 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 `#callHandler(Handler) handler`: `GrpcServerRequest`/`GrpcServerResponse` with Protobuf message that handles any method call in a generic way
  - a gRPC message `#callHandler(MethodDescriptor, Handler) handler`: `GrpcServerRequest`/`GrpcServerRequest` with gRPC messages that handles specific service method calls

  NOTE: This class has been automatically generated from the `original` non RX-ified interface using Vert.x codegen.

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static io.vertx.lang.rx.TypeArg<GrpcServer>` | `__TYPE_ARG`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `GrpcServer(GrpcServer delegate)`
    `GrpcServer(Object delegate)`

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete 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.
    `<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.
    `boolean` | `equals(Object o)`
    `GrpcServer` | `getDelegate()`
    `void` | `handle(HttpServerRequest event)` Something has happened, so handle it.
    `int` | `hashCode()`
    `static GrpcServer` | `newInstance(GrpcServer arg)`
    `static GrpcServer` | `server(Vertx vertx)` Create a blank gRPC server
    `static GrpcServer` | `server(Vertx vertx, GrpcServerOptions options)` Create a blank gRPC server
    `String` | `toString()`

    - ### Methods inherited from class java.lang.Object

      `clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

- - ### Field Detail

    - #### __TYPE_ARG

          public static final io.vertx.lang.rx.TypeArg<GrpcServer> __TYPE_ARG

  - ### Constructor Detail

    - #### GrpcServer

          public GrpcServer(GrpcServer delegate)

    - #### GrpcServer

          public GrpcServer(Object delegate)

  - ### Method Detail

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `Object`

    - #### equals

          public boolean equals(Object o)

      Overrides:
        `equals` in class `Object`

    - #### hashCode

          public int hashCode()

      Overrides:
        `hashCode` in class `Object`

    - #### getDelegate

          public GrpcServer getDelegate()

      Specified by:
        `getDelegate` in interface `io.vertx.lang.rx.RxDelegate`

    - #### handle

          public void handle(HttpServerRequest event)

      Something has happened, so handle it.
      Specified by:
        `handle` in interface `Handler<HttpServerRequest>`
      Parameters:
        `event` - the event to handle

    - #### server

          public static GrpcServer server(Vertx vertx)

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

    - #### server

          public 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

          public 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

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

    - #### callHandler

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

      Deprecated.
      Parameters:
        `methodDesc` -
        `handler` -
      Returns:

    - #### newInstance

          public static GrpcServer newInstance(GrpcServer arg)

Copyright © 2025 Eclipse. All rights reserved.