Using ThreadLocal in DGS #720
Unanswered
pkadam1989
asked this question in
Q&A
Replies: 1 comment 3 replies
-
I would avoid using |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I want to add incoming graphql request headers to Threadlocal.
Inside a datafetcher want to construct a RestTemplate client to reach out to another service with these headers. I want to register an interceptor for the RestTemplate which will read headers from ThreadLocal and add it to outgoing request.
Since DGS datafetcher executes on a different thread, I won't have access to the Threadlocal object set in filter.
Need suggestion on how we can achieve this? Any suggestions will be helpful
Beta Was this translation helpful? Give feedback.
All reactions