I am building an application what reads data from the database in every 'n' seconds.. in my @Scheduled method i would like to read data from my database, for configuring my @Scheduled task. It is important to read in every period, because it can change anytime. So when i readed the data 'period' from my db table, i would like to access it into my @Scheduled(fixedDelay = period). My code not using the readed db value at the moment, but copied my code below.
Code:
@Scheduled(fixedDelay = 60000)
public void startSchedule() throws InterruptedException {
//read data from db to configure Scheduling
//equalize fixedDelay = db.getPeriod(); -> i am not able to do that...
//do other fancy thing..
}