Open michaldCX opened 9 months ago
I do have an interceptor that using @Aspect with this method: @Before("execution(public void io.grpc.BindableService+.*(..))") public void beforeEachIncomingGrpcCall() { context.restoreForIncomingGrpcCall(); }
And If I remove it the application start as well
You can also exclude the auto configuration that adds the HealthServiceImpl.
Note: I also had issues with overwriting Bindable.bind/making it non final as that bypassed spring security.
What does your
context.restoreForIncomingGrpcCall();
do?
I dont want to exclude the auto configuration since i do want the functionality of HealthServiceImpl.
context.restoreForIncomingGrpcCall(); Copied values from gRPC context into our contaext (We cannot populate our context directly in IncomingInterceptor, because interceptor and business logic may execute in different threads under high load)
I dont know much about aspect entrypoint syntax. Maybe you can define an exclude somehow. Please be careful when using thread locals in combination with streaming calls like this.
Grpc has a class called Context
that can be used to store variables throughout the entire call. This library uses it to implememt the grpc request scope feature.
Have you considered scoping your context bean instead?
That way you can already use them in the interceptor.
https://grpc-ecosystem.github.io/grpc-spring/en/server/contextual-data.html
Is there anything else we can help you with?
The context
Error creating bean with name 'grpcHealthService'
The question
I'm using grpc-server-spring-boot-starter - 2.14.0.RELEASE ans when start my app i got error while Initialization bean grpcHealthService
Stacktraces and logs
The application's environment
Which versions do you use?
Additional information