scheduled默认是单线程串行,需要配置线程池
以下是基于xml配置
<task:scheduler id="scheduler" pool-size="4" />
<task:scheduled-tasks scheduler="scheduler">
<task:scheduled ref="pmTask" method="getMinutePm" cron="0 0/1 * * * ?"/>
<task:scheduled ref="outsidePmTask" method="getOutsidePm" cron="0 30/30 * * * ?"/>
<task:scheduled ref="pmTask" method="getHourPm" cron="0 0 0/1 * * ? "/>
<task:scheduled ref="pmTask" method="getDayPm" cron="0 0 0 1/1 * ? "/>
</task:scheduled-tasks>
基于注解配置: https://blog.csdn.net/corleone_4ever/article/details/104293012