2

I have a database poller that I have implemented as a scheduled task. I am using Spring 3.0. I want to control the fixed-delay of the scheduled task at runtime using a restful api. Is there a way to achieve this in spring?

as of now i have:



@Scheduled(fixedDelay = 30000)
    public void poll() {

        if (pollingEnabled) {

            // code to do stuff in database
        }
    }

I want the fixedDelay to be dynamic.Thanks.

rearden
  • 21
  • 2
  • possible duplicate of [How to change Spring's @Scheduled fixedDelay at runtime](http://stackoverflow.com/questions/15250928/how-to-change-springs-scheduled-fixeddelay-at-runtime) – Ralph Apr 23 '13 at 16:07
  • 1
    Possible duplicate of [Scheduling a job with Spring programmatically (with fixedRate set dynamically)](http://stackoverflow.com/questions/14630539/scheduling-a-job-with-spring-programmatically-with-fixedrate-set-dynamically) – Steve Chambers Oct 05 '15 at 09:54

0 Answers0