I want to read fixedDelay from a property file so doing below.
@Bean
public Runnable method(){
static final int delay= properties.getConnectionConfig().getConnectMonitorDelay();
return new Runnable() {
@Override
@Scheduled(fixedDelay = delay)
public void run() {}
};
}
properties.getConnectionConfig().getConnectMonitorDelay() already return a primitive int but i am getting below compile error.
The value for annotation attribute Scheduled.fixedDelay must be a constant expression
How to get rid of the compile error?