This question is possibly a duplicate of this older question.
I'm working on a Spring Boot 1.4 application and I have a method of a bean annotated with @Scheduled
.
I need to pass the cron value to the annotation and, since I'm using YAML based configuration, the cron value is stored in the YAML file (application.yaml
).
I can't find a way to pass the property value app.cron
to the annotation.
For instance, this doesn't work
@Scheduled(cron = ${app.cron})
I have also tried to use EL expression, but no luck.
What is the proper way to pass a YAML based property value to a Spring annotation?