How to change Spring's @Scheduled fixedDelay at runtime

前端 未结 5 1893
予麋鹿
予麋鹿 2020-11-30 03:00

I have a requirement to run a batch job at a fixed interval and have the ability to change the time of this batch job at runtime. For this I came across @Scheduled annotatio

5条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2020-11-30 03:57

    You can use a Trigger to dynamically set the next execution time. See my answer here:

    Scheduling a job with Spring programmatically (with fixedRate set dynamically)

提交回复
热议问题