在 application.xml中配置
xmlns:task="http://www.springframework.org/schema/task"
http://www.springframework.org/schema/task http://www.springframework.org/schema/task/spring-task-3.2.xsd
@Schduled 默认是基于单线程执行, 所有的定时任务串行执行,这就可能导致运行时间久的任务,会影响到下一个运行周期的任务。如果需要基于多线程执行,则需要配置
<!-- 任务执行器 pool-size 多线程-->
<task:executor id="executor" pool-size="5" />
<!-- 任务调度器-->
<task:scheduler id