Reputation: 11
When I Schedule a Job for an email Trigger with Cron Expression in Application Properties, email is not trigger and each Time when I stop the Tomcat and reconfigure the Time it is triggering the job.
Upvotes: 1
Views: 705
Reputation: 788
Please verify you have configuration correctly. And trigger job for particular time you have to have method level configuration also as below.
@Configuration
@EnableScheduling
public class SpringConfig {
@Scheduled(cron = "0 0 0 0 * ?")
public void scheduleTaskUsingCronExpression() {
//Email trigger at 12 clock
}
}
Upvotes: 1