Camel Quartz Component创建QuartzScheduler的过程
QuartzScheduler的创建
在QuartzComponent启动时会对QuartzScheduler进行初始化。
org.apache.camel.component.quartz.QuartzComponent#doStart
在创建QuartzScheduler之前首先要创建SchedulerFactory。
首先创建Quartz配置,然后创建StdSchedulerFactory,然后创建StdScheduler。
通过Spring配置文件调整Quartz配置
如果使用Spring Boot可以引入自动配置包
<dependency>
<groupId>org.apache.camel.springboot</groupId>
<artifactId>camel-quartz-starter</artifactId>
<version>x.x.x</version>
<!-- use the same version as your Camel core version -->
</dependency>
然后在Spring配置文件中进行配置,例如如果要调整Quartz线程池的大小可以参考下面的配置
camel:
component:
quartz:
properties:
org:
quartz:
threadPool:
threadCount: 15