How to load a cron expression from db and reschedu

2019-02-16 14:24发布

I'm using Spring scheduling to have batches in my application.

@Scheduled(cron = "${batch.name|0 0 21 * * ?}")
public void restart() { }

Values are load from a properties file and default value from the @Scheduled annotation parameter.

Now, I would like to be able to load a cron value from database (so from an object) without using Quartz library, only with the default Spring scheduler.

Does someone know if and how it is possible?

Thank you in advance.

1条回答
登录 后发表回答