Uploaded image for project: 'Camel'
  1. Camel
  2. CAMEL-7454

Camel-Quartz2 Scheduler Name Difference

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • 2.13.0
    • 2.16.0
    • camel-quartz2
    • Moderate

    Description

      We have a situation where we have multiple quartz routes in different camel contexts. We want to have the same scheduler name for these schedulers.

      In camel-quartz2 version 2.12.2, it works as expected.

      In camel-quartz2 version 2.13.0, each scheduler is appended with the context's name.

      Files

      quartz.LOCAL.properties
      #============================================================================
      # Configure Main Scheduler Properties  
      #============================================================================
      
      org.quartz.scheduler.instanceName = Test2
      org.quartz.scheduler.instanceId = AUTO
      
      #============================================================================
      # Configure ThreadPool  
      #============================================================================
      
      org.quartz.threadPool.class = org.quartz.simpl.SimpleThreadPool
      org.quartz.threadPool.threadCount = 25
      org.quartz.threadPool.threadPriority = 5
      
      
      #============================================================================
      # Configure JobStore  
      #============================================================================
      
      org.quartz.jobStore.class = org.quartz.impl.jdbcjobstore.JobStoreTX
      org.quartz.jobStore.driverDelegateClass = org.quartz.impl.jdbcjobstore.oracle.OracleDelegate
      org.quartz.jobStore.useProperties = true
      org.quartz.jobStore.dataSource = myDS
      org.quartz.jobStore.tablePrefix = QRTZ_
      
      org.quartz.jobStore.isClustered = true
      org.quartz.jobStore.clusterCheckinInterval = 20000
      
      org.quartz.dataSource.myDS.driver = oracle.jdbc.driver.OracleDriver
      org.quartz.dataSource.myDS.URL = jdbc:oracle:thin:@XXXXXXX
      org.quartz.dataSource.myDS.user = XXXXX
      org.quartz.dataSource.myDS.password = XXXXXXXX
      org.quartz.dataSource.myDS.maxConnections = 5
      org.quartz.dataSource.myDS.validationQuery=select 0 from dual
      
      #============================================================================
      # Configure Trigger Logging  
      #============================================================================
      
      org.quartz.plugin.triggHistory.class = org.quartz.plugins.history.LoggingTriggerHistoryPlugin
      org.quartz.plugin.triggHistory.triggerFiredMessage = Trigger \{1\}.\{0\} fired job \{6\}.\{5\} at: \{4, date, HH:mm:ss MM/dd/yyyy}
      org.quartz.plugin.triggHistory.triggerCompleteMessage = Trigger \{1\}.\{0\} completed firing job \{6\}.\{5\} at \{4, date, HH:mm:ss MM/dd/yyyy\}.
      
      TestContext1.xml
      <?xml version="1.0" encoding="UTF-8"?>
      
      <beans xmlns="http://www.springframework.org/schema/beans"
      	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:camel="http://camel.apache.org/schema/spring"
      	xmlns:context="http://www.springframework.org/schema/context"
      	xmlns:util="http://www.springframework.org/schema/util"
      	xsi:schemaLocation="
             http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
             http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd
             http://camel.apache.org/schema/spring http://camel.apache.org/schema/spring/camel-spring.xsd
             http://www.springframework.org/schema/util  http://www.springframework.org/schema/util/spring-util.xsd">
      
      	 <bean id="quartz1" class="org.apache.camel.component.quartz2.QuartzComponent">
      		<property name="propertiesFile" value="config/quartz/quartz.LOCAL.properties" />
        	</bean>
      
      	<camelContext id="TestContext1" xmlns="http://camel.apache.org/schema/spring"
      		xmlns:oas="http://www.verizonwireless.com/oas">
      
      
      		<route id="route1">
      			<from uri="quartz1://RSSX/test1?pauseJob=false&amp;deleteJob=false&amp;stateful=true&amp;cron=30+*+*+*+*+?" />
      			<log message="${header.scheduler} fired route 1"/>		
      		</route>
      		
      	</camelContext>
      	
      </beans>
      

      Results

      Running camel-quartz2 version 2.12.2:

      Quartz scheduler 'Test2' initialized from an externally provided properties instance.
      

      Running camel-quartz2 version 2.13.0:

      Quartz scheduler 'Test2-TestContext1' initialized from an externally provided properties instance.
      

      Attachments

        Activity

          People

            davsclaus Claus Ibsen
            Luckless Dakota Brown
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: