Home > Software design >  Spring Boot Quartz scheduler
Spring Boot Quartz scheduler

Time:03-04

Folks,

I am trying to implement Spring boot with Quartz Scheduler for scheduling jobs in java.My Manager recommend to use single job with different implementation services for all jobs based on job id.But i am not convincing to have single job for all service implementation.

Please guide me to for single job with multiple service class or writing each job for each services.

Thanks in Advance..

CodePudding user response:

I am not quite sure that I understand correctly what is 'service' in your terms. But definitely, the best practice is to have separate jobs, and that way you can create triggers, cron expressions, etc., for each of them.

If you create only one job then you can have only one trigger and specify only one cron expression.

CodePudding user response:

The challenge would be if you have to trigger 2 jobs simultaneously, in that case you would have to maintain an order, otherwise if your jobs require running at different times then you can use a unique trigger instance everytime..

ex.

schedulerInstance.scheduleJob( newTrigger )
  • Related