Interface GrpcService

All Superinterfaces:
com.linecorp.armeria.server.HttpService, com.linecorp.armeria.server.HttpServiceWithRoutes, com.linecorp.armeria.server.Service<com.linecorp.armeria.common.HttpRequest,com.linecorp.armeria.common.HttpResponse>, com.linecorp.armeria.server.ServiceWithRoutes<com.linecorp.armeria.common.HttpRequest,com.linecorp.armeria.common.HttpResponse>, com.linecorp.armeria.common.util.Unwrappable

public interface GrpcService extends com.linecorp.armeria.server.HttpServiceWithRoutes
An HttpService that implements the gRPC wire protocol. Interfaces and binding logic of gRPC generated stubs are supported, however compatibility with gRPC's core java API is best effort.

Unsupported features:

  • There are some differences in the HTTP/2 error code returned from an Armeria server vs gRPC server when dealing with transport errors and deadlines. Generally, the client will see an UNKNOWN status when the official server may have returned CANCELED.
  • Method Details

    • builder

      static GrpcServiceBuilder builder()
      Returns a new GrpcServiceBuilder.
    • isFramed

      boolean isFramed()
      Returns whether this service handles framed requests.
      Returns:
      true if handles framed requests, or false if handles unframed requests.
    • services

      Returns the ServerServiceDefinitions serviced by this service.
    • methods

      @Deprecated default Map<String,ServerMethodDefinition<?,?>> methods()
      Deprecated.
      Returns a Map whose key is a route path and whose value is ServerMethodDefinition, which is served by this service.
    • methodsByRoute

      Map<com.linecorp.armeria.server.Route,ServerMethodDefinition<?,?>> methodsByRoute()
      Returns a Map whose key is a Route and whose value is ServerMethodDefinition, which is served by this service.
    • supportedSerializationFormats

      Set<com.linecorp.armeria.common.SerializationFormat> supportedSerializationFormats()
      Returns the SerializationFormats supported by this service.
    • shouldCachePath

      default boolean shouldCachePath(String path, @Nullable @Nullable String query, com.linecorp.armeria.server.Route route)
      Specified by:
      shouldCachePath in interface com.linecorp.armeria.server.Service<com.linecorp.armeria.common.HttpRequest,com.linecorp.armeria.common.HttpResponse>