Class AbstractUnaryGrpcService
java.lang.Object
com.linecorp.armeria.server.AbstractHttpService
com.linecorp.armeria.server.grpc.protocol.AbstractUnsafeUnaryGrpcService
com.linecorp.armeria.server.grpc.protocol.AbstractUnaryGrpcService
- All Implemented Interfaces:
Unwrappable
,HttpService
,Service<HttpRequest,HttpResponse>
@UnstableApi public abstract class AbstractUnaryGrpcService extends AbstractUnsafeUnaryGrpcService
An
AbstractUnaryGrpcService
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 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 AbstractUnaryGrpcService()
-
Method Summary
Modifier and Type Method Description protected abstract CompletableFuture<byte[]>
handleMessage(byte[] message)
Returns an unframed response message to return to the client, given an unframed request message.protected CompletableFuture<ByteBuf>
handleMessage(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.grpc.protocol.AbstractUnsafeUnaryGrpcService
doPost
Methods inherited from class com.linecorp.armeria.server.AbstractHttpService
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.Service
as, serviceAdded, shouldCachePath, unwrap
-
Constructor Details
-
AbstractUnaryGrpcService
public AbstractUnaryGrpcService()
-
-
Method Details
-
handleMessage
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 intobyte[]
. The returnedbyte[]
will be framed and returned to the client. -
handleMessage
Description copied from class:AbstractUnsafeUnaryGrpcService
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 intoByteBuf
. The returnedByteBuf
will be framed and returned to the client.- Specified by:
handleMessage
in classAbstractUnsafeUnaryGrpcService
-