Annotation Interface Periodic
Annotation placed on methods annotated with
HandleSchedule or on the payload class of a Schedule. If this
annotation is present the same payload will be rescheduled using the configured delay each time after handling.
By default, the periodic schedule will also be automatically started if it isn't running yet.
-
Optional Element Summary
Optional ElementsModifier and TypeOptional ElementDescriptionbooleanReturns true if this periodic schedule should be automatically started if it's not already active.booleanReturns true if the schedule should continue after an error.Define a unix-like cron expression.longReturns the schedule delay intimeUnit()units.longReturns the schedule delay intimeUnit()units after handling of the last schedule gave rise to an exception.longReturns the initial schedule delay.Returns the id of the periodic schedule.Returns the unit fordelay()andinitialDelay().A time zone id for which the cron expression will be resolved. -
Field Summary
Fields
-
Field Details
-
DISABLED
Special expression that can be used to disable automatic periodic scheduling if passed tocron(). If the schedule was already running and is disabled later on using this expression, any previously scheduled messages will be ignored.- See Also:
-
-
Element Details
-
cron
String cronDefine a unix-like cron expression. If a cron value is specified thedelay()in milliseconds is ignored.The fields read from left to right are interpreted as follows.
- minute
- hour
- day of month
- month
- day of week
For example,
"0 * * * MON-FRI"means at the start of every hour on weekdays.It is possible to refer to an application property, e.g. by specifying `${someFetchSchedule}` as cron value. To disable the schedule altogether if the property is *not* set, specify `${someFetchSchedule:-}`.
- Default:
- ""
-
timeZone
String timeZoneA time zone id for which the cron expression will be resolved. Defaults to UTC.- Default:
- "UTC"
-
scheduleId
String scheduleIdReturns the id of the periodic schedule. Defaults to the fully qualified name of the schedule class.- Default:
- ""
-
autoStart
boolean autoStartReturns true if this periodic schedule should be automatically started if it's not already active. Defaults totrue.- Default:
- true
-
delay
long delayReturns the schedule delay intimeUnit()units. Only used ifcron()is blank, in which case this value should be a positive number.- Default:
- -1L
-
continueOnError
boolean continueOnErrorReturns true if the schedule should continue after an error. Defaults totrue.- Default:
- true
-
delayAfterError
long delayAfterErrorReturns the schedule delay intimeUnit()units after handling of the last schedule gave rise to an exception.If this value is smaller than 0 (the default) this setting is ignored and the schedule will continue as if the exception hadn't been triggered. If
continueOnError()is false, this setting is ignored as well.- Default:
- -1L
-
timeUnit
TimeUnit timeUnit- Default:
- MILLISECONDS
-
initialDelay
long initialDelayReturns the initial schedule delay. Only relevant whenautoStart()is true. If initialDelay is negative, the initial schedule will fire after the default delay (configured either viacron()ordelay()).- Default:
- 0L
-