I have created a spring scheduler in maven project but its not starting. Its in separate maven module. When i call myScheduleTask() method from somewhere in project then its starting after that but i need to run it independently without calling. is there anything missing in it. Below is scheduler class i am trying.
@Component
public class MyScheduler {
@Scheduled(fixedRate = 30000)
public void myScheduleTask(){
system.out.println("Scheduler started");
}
}