java - Quartz Scheduler (cron) 能否在同一执行时间调度多个作业?

标签 java spring cron scheduled-tasks quartz-scheduler

我打算使用 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/

相关文章:

java - 使用 LocalDate 获取输入

java - Spring @Scheduled 任务运行两次

java - JSP - 编辑实体时如何设置指定下拉列表中的选定值?

linux - Cron 作业未运行

java - Hibernate JUnit 找不到 hibernate.cfg.xml

java - 布局 xml 中的资源,但编译器错误为 "not found"

java - 为所有 JComponents 设置默认设置的便捷方法是什么

java - 无法从 ADFS 服务器获取 SAML 响应

php - Cron 作业错过了 wget 上的 JSON get 请求

php - 限制 PHP 脚本的建议/技巧