grpc-spring-boot-starter icon indicating copy to clipboard operation
grpc-spring-boot-starter copied to clipboard

Question about applying global interceptors

Open dxGuan opened this issue 5 years ago • 2 comments

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 interceptors to A_Service while A & B & C global interceptors are still active for B_Service.

dxGuan avatar Jul 10 '19 08:07 dxGuan

You will need to specify them as per-service interceptor.

jvmlet avatar Jul 10 '19 10:07 jvmlet

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.

dxGuan avatar Jul 10 '19 11:07 dxGuan