How to wait until the scheduled task completes execution, before starting the next iteration. The following options all fail to work
@Scheduled(cron = "*/30 * * * * *")
@Scheduled(fixedDelay = 30000, initialDelay = 1000)
@Scheduled(fixedRate = 30000, initialDelay = 1000)
I have a thread pool of 100 for running long running tasks within a single iteration
@Configuration
public class SchedulerConfiguration implements SchedulingConfigurer {
@Bean
public Executor taskExecutor() {
return Executors.newScheduledThreadPool(100);
}
@Override
public void configureTasks(ScheduledTaskRegistrar taskRegistrar) {
taskRegistrar.setScheduler(taskExecutor());
}
}