gpt4 book ai didi

java - Spring Boot Apache Camel Quartz JDBC 调度器

转载 作者:行者123 更新时间:2023-11-30 09:59:13 25 4
gpt4 key购买 nike

我将 spring boot 与 apache camel 一起使用,我想创建 quartz 调度程序,但是当我使用此配置时,什么也没有发生:

camel:
component:
quartz2:
properties:
org:
quartz:
scheduler:
instanceName: ClusteredSchedular
instanceId: AUTO
threadPool:
class: org.quartz.simpl.SimpleThreadPool
threadCount: 25
threadPriority: 5
jobStore:
class: org.quartz.impl.jdbcjobstore.JobStoreTX
driverDelegateClass: org.quartz.impl.jdbcjobstore.oracle.OracleDelegate
dataSource: quartz
isClustered: true
clusterCheckinInterval: 20000
dataSource:
quartz:
driver: oracle.jdbc.driver.OracleDriver
URL: jdbc:oracle:thin:@localhost:1521:xe
user: test
password: test
maxConnections: 5
validationQuery: select 1 from dual

有谁知道为什么这个配置不起作用? Camel 只能从默认配置中看到此配置

    org.quartz.scheduler.instanceName: DefaultQuartzScheduler
org.quartz.scheduler.rmi.export: false
org.quartz.scheduler.rmi.proxy: false
org.quartz.scheduler.wrapJobExecutionInUserTransaction: false

org.quartz.threadPool.class: org.quartz.simpl.SimpleThreadPool
org.quartz.threadPool.threadCount: 10
org.quartz.threadPool.threadPriority: 5
org.quartz.threadPool.threadsInheritContextClassLoaderOfInitializingThread: true

org.quartz.jobStore.misfireThreshold: 60000

org.quartz.jobStore.class: org.quartz.simpl.RAMJobStore

最佳答案

我更愿意使用 springboot 数据源来启用 quartz 集群。

spring:
datasource:
driver-class-name: org.postgresql.Driver
url: jdbc:postgresql://127.0.0.1:5432/postgres
username: postgres
password: password
quartz:
scheduler-name: quartzSchedulernot work anymore
jobStoreType: jdbc
startup-delay: PT10S
wait-for-jobs-to-complete-on-shutdown: true
properties:
org.quartz.scheduler.instanceId: AUTO
org.quartz.scheduler.jmx.export: true
org.quartz.threadPool.threadCount: 15
org.quartz.threadPool.threadPriority: 5
org.quartz.threadPool.class: org.quartz.simpl.SimpleThreadPool
org.quartz.threadPool.threadsInheritContextClassLoaderOfInitializingThread: true
org.quartz.jobStore.driverDelegateClass: org.quartz.impl.jdbcjobstore.PostgreSQLDelegate
org.quartz.jobStore.tablePrefix: QRTZ_
org.quartz.jobStore.isClustered: true
org.quartz.jobStore.clusterCheckinInterval: 1000

关于java - Spring Boot Apache Camel Quartz JDBC 调度器,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59084419/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com