Java Quartz scheduled Job - disallow concurrent execution of Job

前端 未结 3 1901
醉梦人生
醉梦人生 2020-11-29 09:27

I am using a Quartz Job for executing specific tasks.

I am also scheduling its execution in my Main application class and what i am trying to accomplish is not to a

相关标签:
3条回答
  • 2020-11-29 09:55

    @DisallowConcurrentExecution can do your job but please consider that it would only prevent your class from being run twice on the same node.

    Please see @ReneM comment in Quartz 2.2 multi scheduler and @DisallowConcurrentExecution

    0 讨论(0)
  • 2020-11-29 10:04

    You can implement StatefulJob or annotate DisallowConcurrentExecution

    0 讨论(0)
  • 2020-11-29 10:12

    Just use the @DisallowConcurrentExecution Annotation on top of the Job class.

    See this official example or this tutorial about concurrent job execution.

    0 讨论(0)
提交回复
热议问题