我打算使用 Quartz cron 调度程序来安排作业。我的调度模式可能需要多个作业(比如 A、B、C)才能同时运行(比如每 10 分钟 A 和 B 都应该并行运行)。现在,我对它的看法 Quartz 似乎限制了这个功能。我使用 Spring 框架。
问题 - 能否使用 Quartz Cron 创建/实现计划?能够在同一执行时间运行多个作业?
谢谢!
最佳答案
是的,您可以配置 Quartz 的线程计数属性 scheduler thread pool :
org.quartz.threadPool.threadCount
Can be any positive integer, although you should realize that only numbers between 1 and 100 are very practical. This is the number of threads that are available for concurrent execution of jobs. If you only have a few jobs that fire a few times a day, then 1 thread is plenty! If you have tens of thousands of jobs, with many firing every minute, then you probably want a thread count more like 50 or 100 (this highly depends on the nature of the work that your jobs perform, and your systems resources!).
关于java - Quartz Scheduler (cron) 能否在同一执行时间调度多个作业?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24884311/