spring @Scheduled 并发执行

时间:2015-04-25 01:41:49   收藏:0   阅读:1638

spring @Scheduled ,默认基于单线程执行,如果需要基于多线程执行,需要在配置文件中配置如下 


 <task:scheduler id="scheduler" pool-size="10" />
<task:executor id="executor" keep-alive="7200" pool-size="100-200"
queue-capacity="500" rejection-policy="CALLER_RUNS" />
<task:annotation-driven executor="executor"
scheduler="scheduler" />

具体可以参考spring 帮助文档对annotation-driven的executor和scheduler的解释

评论(0
© 2014 mamicode.com 版权所有 京ICP备13008772号-2  联系我们:gaon5@hotmail.com
迷上了代码!