Jonas
JCHJava Community | Help. Code. Learn.
•Created by Jonas on 9/30/2024 in #java-help
Spring gRPC Contexts don't work as expected
Hey!
I'm using Spring Boot gRPC and encountered the problem that my set context (which I prepare in a @ServerInterceptor) is not used in exceptions at @GrpcAdvice ExceptionHandler. It handles Context.current() generation 5, while I intercept all incoming calls with a context of generation 6, in which I have prepared the user's metadata. The service methods also work with
Context.current()
with generation 6 and have access to the prepared metadata, but the exception handler does not.
How can I tell my ExceptionHandler to use the latest context generation (which should be 6 and not 5)?
Thanks in advance!5 replies