Spring线程池—TaskDecorator线程的装饰(跨线程传递ThreadLocal的方案)
ThreadPoolTaskExecutor在执行线程时,存在一个TaskDecorator配置,可以装饰线程类。1.源码分析源码:org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor#initializeExecutor@OverrideprotectedExecutorServiceinitializeExecutor