-1

I'm trying to add a module in my spring boot project. i want from the module is that it sends message to member automatically 2 days before due date.

2 Answers2

0

Create a job schedule to pick the 2 days before due date, generate corn expression. prepare the data in JobDataMap and trigger the job. please follow below link for an example https://github.com/callicoder/spring-boot-quartz-scheduler-email-scheduling

0

Spring makes it very easy through cron

Add this to your properties file (for 6/2/2020 at 9)

cron.specificdate=0 0 9 6 2 ? 2020

And

@Scheduled(cron = "${cron.specificdate}")
public void scheduleTask(){
  ...
}
inquirymind
  • 135
  • 1
  • 11