Annotation Interface GrpcService
Annotation that marks gRPC services that should be registered with a gRPC server. If spring-boot's auto configuration
is used, then the server will be created automatically. This annotation should only be added to implementations of
BindableService
(GrpcService-ImplBase).
Note: These annotation allows the specification of custom interceptors. These will be appended to the global
interceptors and applied using ServerInterceptors.interceptForward(BindableService, ServerInterceptor...)
.
-
Optional Element Summary
Optional ElementsModifier and TypeOptional ElementDescriptionString[]
A list ofServerInterceptor
beans that should be applied to only this service.Class<? extends ServerInterceptor>[]
A list ofServerInterceptor
classes that should be applied to only this service.boolean
Whether the custom interceptors should be mixed with the global interceptors and sorted afterwards.
-
Element Details
-
interceptors
Class<? extends ServerInterceptor>[] interceptorsA list ofServerInterceptor
classes that should be applied to only this service. If a bean of the given type exists, it will be used; otherwise a new instance of that class will be created via no-args constructor.Note: Please read the javadocs regarding the ordering of interceptors.
- Returns:
- A list of ServerInterceptor classes that should be used.
- Default:
- {}
-
interceptorNames
String[] interceptorNamesA list ofServerInterceptor
beans that should be applied to only this service.Note: Please read the javadocs regarding the ordering of interceptors.
- Returns:
- A list of ServerInterceptor beans that should be used.
- Default:
- {}
-
sortInterceptors
boolean sortInterceptorsWhether the custom interceptors should be mixed with the global interceptors and sorted afterwards. Use this option if you want to add a custom interceptor between global interceptors.- Returns:
- True, if the custom interceptors should be merged with the global ones and sorted afterwards. False otherwise.
- Default:
- false
-