Manikanta
Manikanta

Reputation: 33

Using java I need to send Notification Message, by calculating time automatically everyday at 5AM

I need to send Notification Messages to the registered customers, by using the mail service we need to send mail everyday at 5AM by calculating the time automatically. We have mail service code completely. But how to execute one job at specified time everyday.

Upvotes: 0

Views: 99

Answers (1)

Jaiwo99
Jaiwo99

Reputation: 10017

You can use spring scheduler:

@Scheduler(cron="0 0 5 * * *")
public void emailJob() {
  // your code
}

also need the annotation on class level: @EnableScheduling

Upvotes: 1

Related Questions