The update of a QuartzJob within a spring boot application works while the job is not running (here or here). The spring variable spring.quartz.overwrite-existing-jobs: true is set.
However, when doing the same from within a running job the job keeps firing itself in an endless loop without taking into account the interval time (each few milliseconds it fires again). I even tried doing the same from within a TriggerListener but that doesn't change it.
As code example I would have nothing else but what is given in the second link above:
// retrieve the trigger
Trigger oldTrigger = sched.getTrigger(triggerKey("oldTrigger", "group1");
// obtain a builder that would produce the trigger
TriggerBuilder tb = oldTrigger.getTriggerBuilder();
// update the schedule associated with the builder, and build the new trigger
// (other builder methods could be called, to change the trigger in any desired way)
Trigger newTrigger = tb.withSchedule(simpleSchedule()
.withIntervalInSeconds(10)
.withRepeatCount(10)
.build();
sched.rescheduleJob(oldTrigger.getKey(), newTrigger);
Did anyone try that from within a running job?