I have an existing properties file like below
csv.requireresync=true
There are two actions in the system that will get and set value to it.
Every 5 minutes there will a process that will set the
csv.requireresync
to false.Every 2 weeks there will be a process that will set the
csv.requireresync
to true.
I tried to do the above using @Component
but not working
@Component
@ConfigurationProperties(prefix = "csv")
public class ResyncConfig {
private boolean requireresync;
public void setRequireresync(boolean requireresync) {
this.requireresync = requireresync;
}
public boolean isRequireresync() {
return requireresync;
}
}
The idea is when the I call setRequireresync
to true the value must reflect in the application.properties file.
Is it possible achieve what I want ? or do I need a extra configuration file for that ?