My requirement:
I have a spring batch job with fixed delay as 5 sec. So my job will poll a web service for every 5 sec and based on the response(case when I get 200 ok status ) I need to put the current job to sleep for 30 seconds and after that it has to resume polling the web service every 5 seconds
Is there any way to configure this dynamically during run time ?? I need to change the fixed delay property in Reader part.
My sample TestJob config:
@Scheduled(fixedDelay = 5000L) // I need to change this property dynamically @ runtime 
    public void TestEventScheduler() {
        JobParameters jobParameters = new JobParametersBuilder().addLong("TestDataJobTime", System.currentTimeMillis()) 
                .toJobParameters();
        try {
            jobLauncher.run(TestDataJob, jobParameters);
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
 
     
    