spring @Scheduled 并发执行

时间:2015-04-25 01:39:53   收藏:0   阅读:1114

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的解释

原文:http://blog.csdn.net/pan051/article/details/45259073

评论(0
© 2014 bubuko.com 版权所有 - 联系我们:wmxa8@hotmail.com
打开技术之扣,分享程序人生!