michaelklishin / quartz-mongodb

A MongoDB-based store for the Quartz scheduler. This fork strives to be as feature complete as possible. Originally by MuleSoft.
Other
247 stars 199 forks source link

scheduler.rescheduleJob() when used with quartz-mongodb does not allow jobDap map to be updated #160

Open nameetpai opened 6 years ago

nameetpai commented 6 years ago

The implementation in MongoDBJobStore.replaceTrigger() copies over the jobData map from the old trigger, so it doesn't honor new jobData.

There is already a mechanism in place if users of quartz scheduler want to copy over the previous jobData and that's by using oldTrigger.getTriggerBuilder() to clone the previous trigger data and replace only what needs to be updated.

MongoDBJobStore (more specifically TriggerAndJobPersister) should not try to go beyond the documented behavior - https://www.quartz-scheduler.org/api/2.3.0/org/quartz/Scheduler.html#rescheduleJob-org.quartz.TriggerKey-org.quartz.Trigger-)

michaelklishin commented 6 years ago

Feel free to submit a PR that does the right thing, please include a test or two.