Package com.linecorp.armeria.server.grpc
Interface GrpcService
- All Superinterfaces:
HttpService
,HttpServiceWithRoutes
,Service<HttpRequest,
,HttpResponse> ServiceWithRoutes<HttpRequest,
,HttpResponse> Unwrappable
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 Summary
Modifier and TypeMethodDescriptionstatic GrpcServiceBuilder
builder()
Returns a newGrpcServiceBuilder
.boolean
isFramed()
Returns whether this service handles framed requests.default @Nullable ServerMethodDefinition<?,
?> Returns theServerMethodDefinition
of the current request.default Map<String,
ServerMethodDefinition<?, ?>> methods()
Returns aMap
whose key is a route path and whose value isServerMethodDefinition
, which is served by this service.Map<Route,
ServerMethodDefinition<?, ?>> Returns aMap
whose key is aRoute
and whose value isServerMethodDefinition
, which is served by this service.services()
Returns theServerServiceDefinition
s served by this service.default boolean
shouldCachePath
(String path, @Nullable String query, Route route) Returns whether the givenpath
andquery
should be cached if the service's result is successful.Returns theSerializationFormat
s supported by this service.Methods inherited from interface com.linecorp.armeria.server.HttpService
decorate, decorate, exchangeType, serve
Methods inherited from interface com.linecorp.armeria.server.Service
as, serviceAdded, unwrap
Methods inherited from interface com.linecorp.armeria.server.ServiceWithRoutes
routes
Methods inherited from interface com.linecorp.armeria.common.util.Unwrappable
equalsIgnoreWrapper, unwrapAll
-
Method Details
-
builder
Returns a newGrpcServiceBuilder
. -
isFramed
boolean isFramed()Returns whether this service handles framed requests.- Returns:
true
if handles framed requests, orfalse
if handles unframed requests.
-
services
List<ServerServiceDefinition> services()Returns theServerServiceDefinition
s served by this service. -
methodDefinition
@Nullable @UnstableApi default @Nullable ServerMethodDefinition<?,?> methodDefinition(ServiceRequestContext ctx) Returns theServerMethodDefinition
of the current request. -
methods
Returns aMap
whose key is a route path and whose value isServerMethodDefinition
, which is served by this service. -
methodsByRoute
Map<Route,ServerMethodDefinition<?, methodsByRoute()?>> Returns aMap
whose key is aRoute
and whose value isServerMethodDefinition
, which is served by this service. -
supportedSerializationFormats
Set<SerializationFormat> supportedSerializationFormats()Returns theSerializationFormat
s supported by this service. -
shouldCachePath
Description copied from interface:Service
Returns whether the givenpath
andquery
should be cached if the service's result is successful. By default, exact path mappings with no input query are cached.- Specified by:
shouldCachePath
in interfaceService<HttpRequest,
HttpResponse>
-