Ad

Spring Scheduler - Spring Cron Expression For Once Every Last Month Of Quarter On Earliest Of The Last 5 Weekdays?

- 1 answer

We have a requirement to trigger a spring scheduler once every last month of quarter and earliest of the last 5 weekdays.

Is it possible to do this using spring cron expression? Or should we go ahead with using a cron for every 3rd month of quarter and have checks in java code to handle the condition of earliest of the last 5 weekdays?

Ad

Answer

We used a spring cron expression to run the scheduler every weekday of days 26th to 29th of Mar, Jun, Sep, Dec months. Then in java code we checked whether it is earliest of the weekdays.

Ad
source: stackoverflow.com
Ad