As mentioned in #https://github.com/spring-projects/spring-framework/issues/33780#issuecomment-2442241269, there are scenarios where a ThreadPoolTaskExecutor or ThreadPoolTaskScheduler benefits from being configured with a factory for virtual threads. In contrast to SimpleAsyncTaskExecutor/SimpleAsyncTaskScheduler, this is naturally integrated with Spring's lifecycle management for stopping and restarting execution threads, including an early stop signal for a graceful shutdown arrangement. For 6.2, we can provide first-class virtual thread support through a setVirtualThreads(true) flag on ThreadPoolTaskExecutor and ThreadPoolTaskScheduler.
As mentioned in #https://github.com/spring-projects/spring-framework/issues/33780#issuecomment-2442241269, there are scenarios where a
ThreadPoolTaskExecutor
orThreadPoolTaskScheduler
benefits from being configured with a factory for virtual threads. In contrast toSimpleAsyncTaskExecutor
/SimpleAsyncTaskScheduler
, this is naturally integrated with Spring's lifecycle management for stopping and restarting execution threads, including an early stop signal for a graceful shutdown arrangement. For 6.2, we can provide first-class virtual thread support through asetVirtualThreads(true)
flag onThreadPoolTaskExecutor
andThreadPoolTaskScheduler
.