简体   繁体   中英

Spring boot Apache Camel Quartz JDBC scheduler

I using spring boot with apache camel and I want to create quartz scheduler but when I using this configuration nothing has happened:

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

Does anyone have an idea why this configuration doesn't work? Camel only see this configuration from default config

    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

I would prefer to use springboot datasource to enable quartz clustering.

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM