Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can Quartz Scheduler Run jobs serially?

I'm looking into using Quartz Scheduler, and I was wondering if it was possible to schedule jobs not by time, but when another job finishes. So, when Job A is done, it starts Job B. When that's done, it starts Job C, etc.

Job A -> Job B -> Job C -> Job A... continuously.

Is this the right tool for the job? Or should I be looking into something else?

like image 326
Newtang Avatar asked Aug 27 '12 00:08

Newtang


People also ask

How do I run multiple jobs in quartz scheduler?

If you want to schedule multiple jobs in your console application you can simply call Scheduler. ScheduleJob (IScheduler) passing the job and the trigger you've previously created: IJobDetail firstJob = JobBuilder. Create<FirstJob>() .

How does Quartz scheduling work?

Quartz scheduler allows an enterprise to schedule a job at a specified date and time. It allows us to perform the operations to schedule or unschedule the jobs. It provides operations to start or stop or pause the scheduler. It also provides reminder services.

Is Quartz scheduler distributed?

Quartz is distributed as a small java library (. jar file) that contains all of the core Quartz functionality. The main interface (API) to this functionality is the Scheduler interface. It provides simple operations such as scheduling/unscheduling jobs, starting/stopping/pausing the scheduler.


1 Answers

Check out JobChainingJobListener, built-in to Quartz (bold mine):

Keeps a collection of mappings of which Job to trigger after the completion of a given job. If this listener is notified of a job completing that has a mapping, then it will then attempt to trigger the follow-up job. This achieves "job chaining", or a "poor man's workflow".

That's right, you are looking for a process or workflow engine. Have a look at activiti or jbpm.

like image 54
Tomasz Nurkiewicz Avatar answered Sep 30 '22 04:09

Tomasz Nurkiewicz