grpc-ecosystem / grpc-ecosystem/grpc-spring

Optional interceptors in @GrpcService annotation

Open
#630 1 comment 0 reactions 0 assignees View on GitHub
question
Dominant language
Java
Stars
3.7k
Forks
858
PR merge metrics
No merged PRs in 30d

Description

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.

Contributor guide

Open the contributing guide

Research direction

Start by tracing how @GrpcService discovers and registers ServerInterceptor beans, then compare that path with the manually mentioned GrpcServerConfigurer approach. Check how an interceptor depending on an optional bean behaves when that bean is absent. Done should include the requested optional-registration behavior and tests covering both bean-present and bean-absent cases.

Written by the indexing model from the issue text.

Assessment

Tech stack
grpc, java, spring, spring-boot
Domain
api, backend
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.