@Bean public TaskScheduler taskScheduler() { ThreadPoolTaskScheduler taskScheduler = new ThreadPoolTaskScheduler(); taskScheduler.setPoolSize(50); return taskScheduler; }
如果没有指定TaskScheduler则会创建一个单线程的默认调度器。因此问题就清楚了,需要自己创建一个TaskScheduler。