I'm in the following situation: a ThreadPoolScheduler and two methods annotated with @Scheduled.
@Bean
public ThreadPoolTaskScheduler serviceRegistryTaskScheduler() {
final ThreadPoolTaskScheduler threadPoolTaskScheduler = new ThreadPoolTaskScheduler();
threadPoolTaskScheduler.setPoolSize( 2 );
return threadPoolTaskScheduler;
}
@Scheduled( initialDelay = 3000, fixedDelay = 3000 )
public void methodOne() {
// do this
}
@Scheduled( initialDelay = 3000, fixedDelay = 3000 )
public void methodTwo() {
// do that
}
I basically want to stop one of the two @Scheduled methods. Is there a way to do it?