I have multiple QuartzJobBean in a Spring Framework application. These jobs are scheduled according to their needs. I have a problem like the following.
A job fires every 5 seconds.
Let’s say;
1st execution at 00.00.05
2nd execution at 00.00.10
3rd execution at 00.00.15
.
.
.
etc.
However if 1st execution lasts 6 seconds, 2nd execution comes right after the first execution’s completion. I want to schedule my jobs as the following if it is possible?
1st execution at 00.00.05 (execution time 6 seconds)
2nd execution at 00.00.16 (execution time 3 seconds)
3rd execution at 00.00.24 (execution time x seconds)
4th execution at 00.00.24+5+x
.
.
.
etc.
Thanks in advance.
I ended up extending QuartzJobBean and also implementing StatefulJob. As trigger I used SimpleTriggerBean with repeatInterval property xxxx milliseconds.
MyJob class
springcontext