“延迟”是什么意思?实施 StatefulJob 时意味着什么?

发布于 2024-11-08 14:40:46 字数 195 浏览 0 评论 0原文

我已经知道,当使用quartz并且我们不想要并发作业时,我们需要实现StatefulJob并且作业不会同时运行,但我想知道在execute(xx)方法完成之前发生的新触发器将意味着什么会被耽误吗?这是否意味着一旦作业完成,被延迟的作业就会立即被解雇,或者只是被跳过并等待下一个触发? 我还想为每个未触发的触发器保留记录,因为它已经在运行,那么石英会以某种方式告诉我这些信息吗?

i already know that when using quartz and we dont want concurrent jobs, we need to implement the StatefulJob and the jobs wont run simultaneously but i wanna know what does it mean that new triggers that occur before the completion of the execute(xx) method will be delayed? does it mean that once the job is completed, the one that is delayed is fired immediately or it will just be skipped and waiting for the next trigger?
also i want to keep a record for each trigger that is not fired because it was already running, so does quartz tell me this information in some way?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

客…行舟 2024-11-15 14:40:46

“延迟”意味着即使下一次触发时间已经到来,Quartz 也不会选择触发。

一旦正在运行的作业实例完成,触发器将再次成为触发的候选者,并且如果下一个触发时间已到达(或过去),它将被触发。

需要注意的是,被阻塞的扳机会受到失火处理的影响。如果它被阻止的时间超过您配置的失火阈值(默认为 1 分钟),则将应用触发器的失火指令,这取决于您为该触发器选择的指令,可能会导致触发器触发跳过,或者可能导致快速重复(试图赶上)。

您可以实现一个 TriggerListener 来接收失火通知,但不存在仅用于阻止执行的触发器的事件。

"Delayed" means that Quartz won't select the trigger for firing even though its next fire time has arrived.

Once the running job instance completes, the trigger will again be candidate for firing, and if the next fire time has arrived (or past) it will be fired.

The caveat to this is that the blocked trigger is subject to misfire handling. If it is blocked for more time than your configured misfire threshold (defaults to 1 minute) then the trigger's misfire instruction will be applied, which depending upon which you selected for that trigger, may cause a skip in the trigger's firings, or may cause a rapid repeat (attempting to catch up).

You can implement a TriggerListener to be notified of misfires, but there is no event simply for a trigger being blocked from execution.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文