Provide support for disabling cron-based scheduled jobs registered via SchedulingConfigurer #23568
Labels
in: core
Issues in core modules (aop, beans, core, context, expression)
type: enhancement
A general enhancement
Milestone
Support for special cron value of
-
(as defined inScheduled#CRON_DISABLED
) was introduced in #21397 however this is limited to use of@Scheduled
.For scheduled jobs registered via
SchedulingConfigurer
this is not supported which means there's no way to disable scheduled job by supplying the cron value.This can be demonstrated using a simple Spring Boot based sample application:
This works equally well for all cases, except for
-
which will blow up withjava.lang.IllegalArgumentException: Cron expression must consist of 6 fields (found 1 in "-")
when supplied forticker2.cron
.The text was updated successfully, but these errors were encountered: