Basically I have some cron - properties in my application.yml:
B = 0 11/15 * * * ?
I have a bean RefresherB which has
@Scheduled(cron = "${B}")
public void refresh() {
//Refreshing
}
I also have a rest endpoint from which I want to update this B property
@RequestMapping("schedule")
public boolean changeRefreshSchedule(@QueryParam("cron") String expression){
Where I want to update the B property so that the RefresherB bean also gets the update. How would I go about doing this? I do not want to change the application.yml file only update the value for runtime.