Closed
Description
Ivan Bovin opened SPR-12872 and commented
If we have a @Scheduled
method in a @Lazy
bean, it will be added to ScheduledTaskRegistrar
(e.g. using a addFixedDelayTask
method) but not scheduled in the taskScheduler
.
Example:
@Lazy
@Component
public class SampleBean {
@Scheduled(fixedDelay = 500)
public void task() {
System.out.println("-");
}
}
Affects: 4.1.5
Issue Links:
- ScheduledAnnotationBeanPostProcessor should unregister tasks on destruction of individual beans [SPR-12216] #16830 ScheduledAnnotationBeanPostProcessor should unregister tasks on destruction of individual beans
- @Scheduled methods in @Lazy beans are not scheduled [SPR-17587] #22119
@Scheduled
methods in@Lazy
beans are not scheduled - Performance regression when scheduling is enabled and context contains URL beans [SPR-14666] #19230 Performance regression when scheduling is enabled and context contains URL beans
- Improve reference documentation for Task Execution and Scheduling about bean scopes [SPR-14167] #18739 Improve reference documentation for Task Execution and Scheduling about bean scopes
Referenced from: commits ab478d1