I know I can inject the value from properties file with the following syntax:
@Scheduled(fixedRate=${myRate})
public void getSchedule(){
System.out.print
In my application I use the annotation PropertySource
on my config class:
@PropertySource("application-${spring.profiles.active}.yml")
spring.profiles.active
returns the active profile (dev, test, etc). My properties file name is application-dev.yml
The annotation @Scheduled
works with property injection.
Dont forget the annotation with prefix configuration on your class.