grpc-spring-boot-starter
grpc-spring-boot-starter copied to clipboard
Question about applying global interceptors
I have a several gRPC services, which are annotated by @GRpcService
and a few global interceptors, which are annotated by @GRpcGlobalInterceptor
.
Is it possible to apply only a few of the global interceptors for a gRPC service while leaving the rest of the global interceptors inactive, say I have:
- A_Service, B_Service which are gRPC services.
- A_GlobalInterceptor, B_GlobalInterceptor, C_GlobalInterceptor
I want to apply only A & C global interceptor
s to A_Service while A & B & C global interceptor
s are still active for B_Service.
You will need to specify them as per-service interceptor.
I think it would be nice if @GRpcService
has an extra metadata, like: excludes
which can be applied to exclude some global interceptors.
If I have a bunch of services who just need to exclude very few of these global interceptors, I have to disable applying global interceptors in @GRpcService
while setting the necessary interceptors explicitly.