-
Notifications
You must be signed in to change notification settings - Fork 38.5k
Support SpEL next to placeholders in annotation attributes (e.g. @Scheduled) [SPR-13625] #18203
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Juergen Hoeller commented This is actually by design, since SpEL expressions are semantically meant to be re-evaluated every time, whereas simple placeholder variables are semantically resolved once only - against the current values at startup. Scheduling requires a pre-defined trigger and is therefore semantically a match for placeholders but not really for fully dynamic SpEL expressions. Do you have a specific use case? Could you use Juergen |
Neil Green commented It's not completely clear to me what "re-evaluated every time" means in this context. I understand that, for instance, in a Spring Integration application, using SpEL to make a routing decision we would want the expression to be evaluated each time a routing decision is made, but I don't think that applies here, it's simply extracting a value from the application context at startup. There are other Spring annotations that support SpEL in the way described, e.g. org.springframework.amqp.rabbit.annotation.RabbitListener's queues field is resolved for both placeholders and full SpEL expressions in RabbitListenerAnnotationBeanPostProcessor. It would be good if we could replicate that behaviour in the Would it be worth submitting a merge request for consideration? |
Juergen Hoeller commented Alright, we'll have a broader look at this (also including Juergen |
Juergen Hoeller commented As of 4.3, all Juergen |
Joseph Dawson opened SPR-13625 and commented
Currently The
@Scheduled
(fixdRateString) annotation supports property evaluations, however it does not parse spring expressions correctly.The problem has been recreated at https://github.com/rikitikitaco/schedulerSpel
Reference URL: https://github.com/rikitikitaco/schedulerSpel
Issue Links:
@Scheduled
annotation fixedDelayString attribute does not resolve SpEL expressions ("is duplicated by")@Scheduled
.fixedDelayString ("is duplicated by")@RequestHeader
name/value does not accept placeholdersReferenced from: commits ea4a766
The text was updated successfully, but these errors were encountered: