Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to queue jobs in quartz

I have several quartz scheduled jobs. With the help of attribute DisallowConcurrentExecution they do not execute simultaneously. But if they fire at one time, one job is missed. How to fix it (to put in queue)? I tried to use Mutex, but in result jobs were started and executed simultaneously, interrupting each other. I want one is done, the second will start after/ What to do?

like image 642
Lili Avatar asked Oct 19 '25 03:10

Lili


1 Answers

You could use a JobChainingJobListener for this. It listens for your job to finish and then triggers the next job on the list and so on.

Take a look at the code to see how it works if you want to do this on your own.

like image 154
jvilalta Avatar answered Oct 22 '25 01:10

jvilalta



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!