Class AbstractUnsafeUnaryGrpcService

java.lang.Object
com.linecorp.armeria.server.AbstractHttpService
com.linecorp.armeria.server.grpc.protocol.AbstractUnsafeUnaryGrpcService
All Implemented Interfaces:
com.linecorp.armeria.common.util.Unwrappable, com.linecorp.armeria.server.HttpService, com.linecorp.armeria.server.Service<com.linecorp.armeria.common.HttpRequest,com.linecorp.armeria.common.HttpResponse>
Direct Known Subclasses:
AbstractUnaryGrpcService

@UnstableApi public abstract class AbstractUnsafeUnaryGrpcService extends com.linecorp.armeria.server.AbstractHttpService
An AbstractUnsafeUnaryGrpcService can be used to implement a gRPC service without depending on gRPC stubs. This service takes care of deframing and framing with the gRPC wire format and handling appropriate headers. This unsafe version of a unary gRPC service accepts and returns pooled ByteBuf for payloads. It is for advanced users only, and it is generally recommended to use normal gRPC stubs or AbstractUnaryGrpcService.

This service does not support compression. If you need support for compression, please consider using normal gRPC stubs or file a feature request.

  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    protected final com.linecorp.armeria.common.HttpResponse
    doPost(com.linecorp.armeria.server.ServiceRequestContext ctx, com.linecorp.armeria.common.HttpRequest req)
     
    com.linecorp.armeria.common.ExchangeType
    exchangeType(com.linecorp.armeria.server.RoutingContext routingContext)
     
    protected abstract CompletionStage<ByteBuf>
    handleMessage(com.linecorp.armeria.server.ServiceRequestContext ctx, ByteBuf message)
    Returns an unframed response message to return to the client, given an unframed request message.

    Methods inherited from class com.linecorp.armeria.server.AbstractHttpService

    doConnect, doDelete, doGet, doHead, doOptions, doPatch, doPut, doTrace, serve

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface com.linecorp.armeria.server.HttpService

    decorate, decorate, options

    Methods inherited from interface com.linecorp.armeria.server.Service

    as, serviceAdded, shouldCachePath, unwrap

    Methods inherited from interface com.linecorp.armeria.common.util.Unwrappable

    equalsIgnoreWrapper, unwrapAll
  • Constructor Details

    • AbstractUnsafeUnaryGrpcService

      public AbstractUnsafeUnaryGrpcService()
  • Method Details

    • handleMessage

      protected abstract CompletionStage<ByteBuf> handleMessage(com.linecorp.armeria.server.ServiceRequestContext ctx, ByteBuf message)
      Returns an unframed response message to return to the client, given an unframed request message. It is expected that the implementation has the logic to know how to parse the request and serialize a response into ByteBuf. The returned ByteBuf will be framed and returned to the client.
    • exchangeType

      public com.linecorp.armeria.common.ExchangeType exchangeType(com.linecorp.armeria.server.RoutingContext routingContext)
    • doPost

      protected final com.linecorp.armeria.common.HttpResponse doPost(com.linecorp.armeria.server.ServiceRequestContext ctx, com.linecorp.armeria.common.HttpRequest req)
      Overrides:
      doPost in class com.linecorp.armeria.server.AbstractHttpService