You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Spring Framework 6.2 added support for offloading non-reactive method to an executor, which Spring Boot configures when virtual threads are enabled.
I was hoping I could simply change my app that's currently running with Spring WebMVC and Tomcat to Spring WebFlux and Netty when enabling virtual threads.
There are several RestControllers that perform blocking database and rest calls, and they work as expected when I change the underlying web application type and server.
I am, however, missing a way to inject non-reactive ContextHolder variants that use thread locals, such as RequestContextHolder, LocaleContextHolder and SecurityContextHolder.
I am aware I could wrap each method with reactive variants, but I'd appreaciate if there was a way I could intercept the method call and map the mentioned ContextHolders from their Reactive counterparts without having to modify any code.
Anything that wraps method::invoke call to target method into something that can access ServerWebExchange would be welcome.