Hi i like to take the scheduler value from property file , my spring version is 3.1.2 . I cant update the version of spring . fixedRateString is only available in higher version 3.2.2 . Is there any way i can get this value from property file.
@Scheduled(fixedRate = 1000000)
You can use @Scheduled(cron=". . .")
expressions for task scheduling.
If a fixed rate execution is desired, simply change the property name specified within the annotation. The following would be executed every 5 seconds measured between the successive start times of each invocation.
@Scheduled(fixedRate=5000)
public void doSomething() {
// something that should execute periodically
}
If simple periodic scheduling is not expressive enough, then a cron expression may be provided. For example, the following will only execute on weekdays.
@Scheduled(cron="*/5 * * * * MON-FRI")
public void doSomething() {
// something that should execute on weekdays only
}
spring/docs/3.1.x/spring-framework-reference/html/scheduling.html
cron-expression
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