As discussed here https://github.com/spring-projects/spring-framework/issues/31210 it would be useful to be able to only specify an initialDelay
for @Scheduled
task to run in only once. So without cron/fixedDelay/fixedRate to be specified.
Comment From: marceloverdijk
Some background.
Many used something like @Scheduled(initialDelay = 5, fixedDelay = Long.MAX_VALUE)
for this, but that resulted in an unexpected ArithmeticException in 6.0.10 (https://github.com/spring-projects/spring-framework/issues/30754).
This was fixed in 6.0.11 but in other cases like @Scheduled(initialDelay = 5, fixedDelay = Integer.MAX_VALUE, timeUnit = TimeUnit.MINUTES)
this still happens.
So it would be nice to be able to configure an one-time task without setting a fixedDelay in a very far future.
Comment From: marceloverdijk
Thx @jhoeller that was fast ;-)