Class AbstractUnsafeUnaryGrpcService
java.lang.Object
com.linecorp.armeria.server.AbstractHttpService
com.linecorp.armeria.server.grpc.protocol.AbstractUnsafeUnaryGrpcService
- All Implemented Interfaces:
Unwrappable
,HttpService
,Service<HttpRequest,
HttpResponse>
- Direct Known Subclasses:
AbstractUnaryGrpcService
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
-
Method Summary
Modifier and TypeMethodDescriptionprotected final HttpResponse
doPost
(ServiceRequestContext ctx, HttpRequest req) Handles aPOST
request.exchangeType
(RoutingContext routingContext) protected abstract CompletionStage<ByteBuf>
handleMessage
(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
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(ServiceRequestContext ctx, ByteBuf message) -
exchangeType
Description copied from interface:HttpService
Determines anExchangeType
for thisHttpService
from the givenRoutingContext
. By default,ExchangeType.BIDI_STREAMING
is set.Note that an
HttpRequest
will be aggregated before serving theHttpService
ifExchangeType.UNARY
orExchangeType.RESPONSE_STREAMING
is set. -
doPost
Description copied from class:AbstractHttpService
Handles aPOST
request. This method sends a405 Method Not Allowed
response by default.- Overrides:
doPost
in classAbstractHttpService
-