There are two types of the scheduled jobs which OpenHub supports:
If there is only one OpenHub instance then doesn't matter which type of scheduled job is used.
If you use different database than H2 DB then you must create database structure manually from GitHub scripts for concurrent scheduled jobs. See Flyway - schema/data migration for more details. |
@OpenHubQuartzJob(name = "AsyncPostponedJob", executeTypeInCluster = JobExecuteTypeInCluster.NOT_CONCURRENT, simpleTriggers = @QuartzSimpleTrigger(repeatIntervalMillis = 30000)) public void invokePostponedJob() {} |
@OpenHubQuartzJob(name = "MoreTriggerJob", executeTypeInCluster = JobExecuteTypeInCluster.CONCURRENT, cronTriggers = { @QuartzCronTrigger(cronExpression = "0 00 23 ? * *", name = "FirstTriggerForJob", group = "MoreTriggerGroup"), @QuartzCronTrigger(cronExpression = "0 00 10 ? * *", misfireInstruction = CronTriggerMisfireInstruction.FIRE_ONCE_NOW, name = "SecondTriggerForJob", group = "MoreTriggerGroup")}, simpleTriggers = { @QuartzSimpleTrigger(repeatIntervalMillis = 10000, repeatCount = 20, name = "ThirdTriggerForJob", group = "MoreTriggerGroup"), @QuartzSimpleTrigger(repeatIntervalProperty = ASYNCH_PARTLY_FAILED_REPEAT_TIME_SEC, intervalPropertyUnit = SimpleTriggerPropertyUnit.SECONDS, misfireInstruction = SimpleTriggerMisfireInstruction.FIRE_NOW, name = "FourthTriggerForJob", group = "MoreTriggerGroup") }) public void invokeJob() {} |