Queuing schedular tasks

半城伤御伤魂 提交于 2019-12-13 00:22:38

问题


I'm a project using Spring Roo. I have implemented a scheduler feature on my project following the tutorial about Spring Task Scheduler.

I was planning to add another scheduler but the new scheduler should run at the end of the first scheduler. There's one obvious way for this, to trigger the scheduler method as the last statement of the first scheduler. But that approach would make the first scheduler class dependent on the second scheduler class.

Is there a way to queue two or more schedulers in a way the schedulers are code independent with each other?


回答1:


What you are looking for is job chaining:

http://quartz-scheduler.org/documentation/faq#FAQ-chain

Can Quartz Scheduler Run jobs serially?

You could achieve your goal by using listener that would be notified when job1 is finished and then trigger execution of job2.



来源:https://stackoverflow.com/questions/19246310/queuing-schedular-tasks

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!