As of Spring 5.1.0 the @Scheduled
annotation can accept "-"
as the cron expression to disable the cron trigger.
Per the Javadocs:
The special value
"-"
indicates a disabled cron trigger, primarily meant for externally specified values resolved by a${...}
placeholder.