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

Optional interceptors in @GrpcService annotation

Open maksim-kosolapov opened this issue 3 years ago • 1 comments

Hi! I'm trying to use this starter and I have next problem. I have a ServerInterceptor, that depends on other optional bean (wich enabled through configuration). I need that interceptor only for one service, not global (for global it is easy make with ConditionalOnBean).

Maybe it will be good to add some property (e.g. "required") to @GrpcService annotation to allow to specify optional interceptors? And if there are no bean in app context, then don't fail with error, but just not register it. Now as I understand, I can do this only manually register service through GrpcServerConfigurer.

maksim-kosolapov avatar Jan 23 '22 14:01 maksim-kosolapov

Sounds like a good idea.

ST-DDT avatar Jan 23 '22 15:01 ST-DDT