1
votes

I have question about approach I should use for my case. I have to schedule a job which will use user input (start date/time and file - user can pick start date/time and file on frontend). Job will do the same thing everytime, but with different file, cron expression and schedule name. So no functional changes in job - only different parameters.

For now there are java config classes with beans to configure jobs and I'm now thinking if it is possible to create new configuration class and change somehow parameters which I'm interested in? Or I shouldn't use beans and create a service where I will build everytime Job, JobDetails, Trigger etc and just schedule it?

I'm completely new in Spring Batch and I had to takeover this part from guy who left the team.

1

1 Answers

0
votes

You need to dynamically create the schedule according to user input. Quartz provides the Trigger interface which you can implement as needed.

A similar question here: Dynamic Job Scheduling with Quartz or any other java api

Hope this helps.