We've a simple requirement to download files from different end point servers. We'll be scheduling these file downloads to happen at various time in the day (customizable from the GUI). We've been using Spring Scheduling & its working for a single job to download from a single server.
Now we would like to extend this operation of downloading the files to more than one server & different time. The operation of file downloading is same, but the time at which it will be running, the end point server, the location to download everything will change per task. Basically we'll be parameterizing these attributes & want to reuse the same job to download the files. Is that possible ?
How to achieve this using Spring Scheduling ?
You can have a timerTask like below from which you can call download logic:-
Now when your application starts you can use this code to make a call to our scheduler method scheduleTaskOfDownload