Hi,
I have Service A which has to call Service B and C asynchronously. So i used Java 8 CompletableFuture supplyAsync method.
Problem:
Service A gets JWT token from the caller , using Server interceptor it validates the token and if the token is valid it is set in the gRPC Context to propagate token to further client calls.
When i put the CompletableFuture , it creates a new thread for Service B and C calls so the gRPC context where the token set is lost. Service B and C calls are failing with missing token.
Background: Earlier Service A calls only B. So the ServerInterceptor which sets the token was available in clientInterceptor for calling B.
As a new enhancement added Service C call.