Package com.linecorp.armeria.server.grpc
Interface GrpcService
- All Superinterfaces:
HttpService,HttpServiceWithRoutes,Service<HttpRequest,HttpResponse>,ServiceWithRoutes<HttpRequest,HttpResponse>,Unwrappable
public interface GrpcService extends 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 Summary
Modifier and Type Method Description static GrpcServiceBuilderbuilder()Returns a newGrpcServiceBuilder.booleanisFramed()Returns whether this service handles framed requests.default Map<String,ServerMethodDefinition<?,?>>methods()Returns aMapwhose key is a route path and whose value isServerMethodDefinition, which is serviced by this service.List<ServerServiceDefinition>services()Returns theServerServiceDefinitions serviced by this service.default booleanshouldCachePath(String path, String query, Route route)Returns whether the givenpathandqueryshould be cached if the service's result is successful.Set<SerializationFormat>supportedSerializationFormats()Returns theSerializationFormats supported by this service.Methods inherited from interface com.linecorp.armeria.server.HttpService
decorate, decorate, serveMethods inherited from interface com.linecorp.armeria.server.Service
as, serviceAdded, unwrapMethods inherited from interface com.linecorp.armeria.server.ServiceWithRoutes
routes
-
Method Details
-
builder
Returns a newGrpcServiceBuilder. -
isFramed
boolean isFramed()Returns whether this service handles framed requests.- Returns:
trueif handles framed requests, orfalseif handles unframed requests.
-
services
List<ServerServiceDefinition> services()Returns theServerServiceDefinitions serviced by this service. -
methods
Returns aMapwhose key is a route path and whose value isServerMethodDefinition, which is serviced by this service. -
supportedSerializationFormats
Set<SerializationFormat> supportedSerializationFormats()Returns theSerializationFormats supported by this service. -
shouldCachePath
Description copied from interface:ServiceReturns whether the givenpathandqueryshould be cached if the service's result is successful. By default, exact path mappings with no input query are cached.- Specified by:
shouldCachePathin interfaceService<HttpRequest,HttpResponse>
-