spring定时任务线程配备(quartz定时器)

spring定时任务线程配置(quartz定时器)

  请注意是quartz定时器,不是timetask定时器!

  spring quartz定时器里面有1个选项,表示是否并行 

  Java代码 15x14

  1. <property name="concurrent" value="false" /> 

  如果是false,那么任务之间不能并行。 

意思是: 
1. 如果你是CronTriggerBean,比如每刻钟执行一次——你0分执行第一次,结果20分才执行完,那么它第30分才执行第二次。 

2. 如果你SimpleTriggerBean,比如说每隔15分钟执行一次——你0分执行了第一次,如果20分钟执行完,那么它会立刻执行第二次 

如果是true的话,就反过来。

  By default, Quartz Jobs are stateless, resulting in the possibility of jobs interfering with each other. If you specify two triggers for the same JobDetail, it might be possible that before the first job has finished, the second one will start. If JobDetail classes implement the Stateful interface, this won't happen. The second job will not start before the first one has finished. To make jobs resulting from the MethodInvokingJobDetailFactoryBean non-concurrent, set the concurrent flag to false.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值