骆驼石英路线不需要的作业执行的航线启动 [英] Camel Quartz route undesired job execution at route startup
问题描述
我有几个途径,看起来像:
I have several routes that looks like :
from("quartz://" + getJobId() + "?cron=" + cronExpression + "&stateful=true")
.routeId(getJobId())
.autoStartup(false)
.to(getRouteTo());
这些路由可以启动,并从管理控制台停止。
我的问题是:
Those routes can be started and stopped from an administration console. The problem I have is the following:
如果路由配置为在每天17:00运行,目前如果我的路线是17:00以后开始,
石英通知,它应该在17:00已经运行,并会尝试恢复错过执行。
If a route is configured to run everyday at 17:00, currently if my route is started after 17:00, quartz notice that it should have run at 17:00 and will try to recover that missed execution.
我不希望这样的事情发生,我想要什么:
I don't want that to happen, what I want:
- 我在17:00之前开始我在第1天的路线,这项工作将在17:00被触发DAY1
- 我开始在17:00之后我在第1天的路线,作业应在17:00被触发DAY2
这是否与我选择了一个有状态作业的事实呢?
我选择了一个有状态的工作,以避免同一作业的并发执行。
Is it related to the fact that I chose a statefull job ? I chose a stateful job to avoid concurrent execution of the same job.
推荐答案
根据克劳斯的建议,或许下面将工作作为石英工作参数(假设你使用的 org.quartz.SimpleTrigger ):
Based on Claus's suggestion, perhaps the following would work as a parameter on the quartz job (assuming you're using a org.quartz.SimpleTrigger):
trigger.misfireInstruction=org.quartz.SimpleTrigger.MISFIRE_INSTRUCTION_RESCHEDULE_NEXT_WITH_EXISTING_COUNT
trigger.misfireInstruction=org.quartz.SimpleTrigger.MISFIRE_INSTRUCTION_RESCHEDULE_NEXT_WITH_EXISTING_COUNT
编辑:基于soilworker的评论,上面应该是:
trigger.misfireInstruction = 2
这篇关于骆驼石英路线不需要的作业执行的航线启动的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!