Description
Andy Wilkinson opened SPR-15982 and commented
We'd like to provide an actuator endpoint in Boot for an application's scheduled tasks. We have a pull request to add the functionality but it (ab)uses SchedulingConfigurer to capture a snapshot of the scheduled tasks during startup. There's an ordering issue here as another configurer may schedule tasks that would be missed. We could keep a reference to the configurer and call it whenever the actuator endpoint is called, but this feels like a larger abuse of the configurer callback.
I had hoped that I could just inject ScheduledTaskRegistrar
but, while its javadoc describes it as a bean, it doesn't appear to actually be one. It also exposes more than I need; I only to read information about registered tasks, not register additional tasks.
Would it be possible to provide an official API for getting information about any scheduled tasks that have been registered? Perhaps via a bean that can be retrieved from the context if the user has enabled scheduling.
Affects: 5.0 RC4
Reference URL: spring-projects/spring-boot#8831
Issue Links:
- ScheduledTaskRegistrar to provide all scheduled tasks with getScheduledTasks() [SPR-16424] #20970 ScheduledTaskRegistrar to provide all scheduled tasks with getScheduledTasks()