I am using @Scheduled
annotation to initialize a task scheduled in my Spring Boot project.
@Override
@Scheduled(cron = "#{scanningTime}")
public void execution() {
invitePlanScanner();
}
But I'm have difficulty to stopping it at runtime. My idea is to initialize a cron job in addition to using annotations that able to dynamically use the methods of the library. But after a period of research, I don't see that java provides a specific way to initialize a job with cron schedule along with a stop method.
Any one have an idea for this problem?