how to use threadlocal in spring cloud gateway
project dependency: spring-cloud-gateway spring-boot-starter-security
I make a threadlocal instance in webfilter(webflux). but i was missing it in globalfilter(spring cloud gateway). what should i to get them to communicate
threadlocal is not supported in reactor which is the basis for webflux which is what gateway is built on. ServerWebExchange has attributes that can be used https://docs.spring.io/spring-framework/docs/current/javadoc-api/org/springframework/web/server/ServerWebExchange.html#getAttributes--
You can also look at the reactor context https://projectreactor.io/docs/core/release/reference/#context
If you would like us to look at this issue, please provide the requested information. If the information is not provided within the next 7 days this issue will be closed.
I set the context in webfilter How can i get the context from globalfilter