Caleb Cushing opened SPR-17443 and commented
I can accept that the parameters need to be some sort of Bean or otherwise resolvable like from property sources, but it seems like that should be possible.
@Scheduled( fixedRateString = CREATED_SCHEDULE_PLACEHOLDER )
void publishCreatedEmrs( @Value( CREATED_SCHEDULE_PLACEHOLDER ) Duration duration ) {
.... code that queries by duration here
Affects: 5.0.10
Comment From: dnl50
Is this something I could take a look into (although I think it might be a little bit complicated)?
Comment From: bclozel
The entire @Scheduled
infrastructure is build around Runnable
and how tasks are scheduled and run. Injecting beans or environment values at the method level should be really done at the class level here. We didn't get much demand nor compelling use cases for this so far.
I'm declining this issue as a result.