Quartz 中的嵌套作业
我有嵌套任务要安排:
(1)。 每日主任务下载调度信息,这是带有时间戳的作业名称列表 (2)。 根据我刚刚下载的调度信息中的时间戳安排作业
我不确定嵌套作业在 Quartz 中如何工作。 看来我需要一个 CronTrigger 来触发一个作业,其中包含多个 SimpleTriggered 作业。 有什么办法可以做到这一点吗? 还有其他选择吗?
谢谢。 百合
I have nested task to schedule:
(1). A daily master task downloading scheduling information, which is a List of job names with timestamps
(2). schedule the job in the scheduling information I just downloaded according to its timestamp
I am not sure how the nested jobs work in Quartz. It seems that I need a CronTrigger triggering a job, which contains multiple SimpleTriggered jobs. Are there any way to do that? Are there any alternatives?
Thanks.
Lily
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
它们并不是真正的嵌套工作。
您是正确的,主作业需要 CronTrigger。 但是,当该作业运行时,它将循环浏览下载的作业列表,为每个条目创建一个作业和一个 SimpleTrigger。 您可以从 CronJob 的 JobExecutionContext 获取 Scheduler 并将作业添加到其中。
宾果游戏,你所有的工作都安排好了。
They aren't really nested jobs.
You are correct in that the master job needs a CronTrigger. But when that job runs it will cycle through the list of jobs downloaded creating a job and a SimpleTrigger for each entry. You can get a Scheduler from the CronJob's JobExecutionContext and add the jobs to it.
And bingo, all your jobs are scheduled.
您基本上需要在 Quartz 作业中运行 Quartz。 这确实没有意义,为什么不使用 Quartz 配置运行所有作业呢? 我认为这种嵌套不是一个好主意。
You basically need to run Quartz inside of your Quartz job. This doesn't really make sense, why don't your just run all of the jobs with Quartz configurations? I don't think this nesting is a good idea.