I use ScheduledThreadPoolExecutor for tasks which have different execution times. For example, one task scheduled for 9:30 PM tonight and the other for 8:00 AM tomorrow. But if the server is shut down for some reason, the tasks disappear.
I am thinking about task persistence in a database so that I can re-trigger the failed tasks at a later time—but I guess that's not a perfect solution.
Are there any good frameworks or any other suggestions for this?
You can use Redis based task scheduling framework like Redisson. It also supports quartz cron experssions. Here is documentation about it
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With