[ 
https://issues.apache.org/jira/browse/CAMEL-7454?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14007105#comment-14007105
 ] 

Dakota Brown commented on CAMEL-7454:
-------------------------------------

We have a front end application to enable and disable these quartz jobs by 
Autowiring the scheduler defined below:

{code:xml}
        <beans:bean id="schedulerFactoryBean" 
class="org.springframework.scheduling.quartz.SchedulerFactoryBean" >
                <beans:property name="applicationContextSchedulerContextKey">
                        <beans:value>applicationContext</beans:value>
                </beans:property>
                <beans:property name="schedulerName" value="Test2"/>
                <beans:property name="autoStartup" value="false"/>
                <beans:property name="quartzProperties">
                        <beans:props>
                                <beans:prop 
key="org.quartz.scheduler.instanceName">Test2</beans:prop>
                                <beans:prop 
key="org.quartz.scheduler.instanceId">14</beans:prop>
                                <beans:prop 
key="org.quartz.jobStore.class">org.quartz.impl.jdbcjobstore.JobStoreTX</beans:prop>
                                <beans:prop 
key="org.quartz.scheduler.skipUpdateCheck">true</beans:prop>
                                <beans:prop 
key="org.quartz.jobStore.driverDelegateClass">org.quartz.impl.jdbcjobstore.oracle.OracleDelegate</beans:prop>
                                <beans:prop 
key="org.quartz.jobStore.useProperties">true</beans:prop>
                                <beans:prop 
key="org.quartz.jobStore.dataSource">myDS</beans:prop>
                                <beans:prop 
key="org.quartz.jobStore.isClustered">true</beans:prop>
                                <beans:prop 
key="org.quartz.jobStore.clusterCheckinInterval">20000</beans:prop>
                                <beans:prop 
key="org.quartz.dataSource.myDS.driver">oracle.jdbc.driver.OracleDriver</beans:prop>
                                <beans:prop 
key="org.quartz.dataSource.myDS.URL">jdbc:oracle:thin:@XXXXXX</beans:prop>
                                <beans:prop 
key="org.quartz.dataSource.myDS.user">XXXXXXX</beans:prop>
                                <beans:prop 
key="org.quartz.dataSource.myDS.password">XXXXXXX</beans:prop>
                                <beans:prop 
key="org.quartz.dataSource.myDS.maxConnections">1</beans:prop>
                                <beans:prop 
key="org.quartz.dataSource.myDS.validationQuery">select 0 from dual</beans:prop>
                        </beans:props>
                </beans:property>
        </beans:bean>
{code}

It's nice having one scheduler to reference instead of multiple schedulers 
dependent on the camel context names (and contexts to be added in the future). 
While the jobs are in different contexts, we wanted one scheduler to control 
all of them. This change in 2.13.0 effectively broke our quartz job manager.

> Camel-Quartz2 Scheduler Name Difference
> ---------------------------------------
>
>                 Key: CAMEL-7454
>                 URL: https://issues.apache.org/jira/browse/CAMEL-7454
>             Project: Camel
>          Issue Type: Improvement
>          Components: camel-quartz2
>    Affects Versions: 2.13.0
>            Reporter: Dakota Brown
>            Assignee: Claus Ibsen
>            Priority: Minor
>              Labels: quartz
>
> 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*
> {code:title = quartz.LOCAL.properties|borderStyle=solid}
> #============================================================================
> # 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\}.
> {code}
> {code:title = TestContext1.xml|borderStyle=solid}
> <?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>
> {code}
> *Results*
> Running camel-quartz2 version 2.12.2:
> {code:xml}
> Quartz scheduler 'Test2' initialized from an externally provided properties 
> instance.
> {code}
> Running camel-quartz2 version 2.13.0:
> {code:xml}
> Quartz scheduler 'Test2-TestContext1' initialized from an externally provided 
> properties instance.
> {code}



--
This message was sent by Atlassian JIRA
(v6.2#6252)

Reply via email to