Skip to content

Provide read access to the scheduled tasks at runtime [SPR-15982] #20532

Closed
@spring-projects-issues

Description

@spring-projects-issues

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:

Referenced from: commits 85baba3, ffd6eff

Metadata

Metadata

Assignees

Labels

in: coreIssues in core modules (aop, beans, core, context, expression)type: enhancementA general enhancement

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions