camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Paul Dailly <>
Subject Spring Camel Quartz cluster configuration
Date Sat, 17 Jan 2015 19:17:45 GMT
Hi there,

I have a Spring application which defines Camel routes triggered using
camel-quartz2 (v2.14.0). The Quartz Camel routes I have configured
successfully trigger when I run a single instance of the app (i.e
non-clustered, in-memory quartz scheduler).

However, I now want to set this up in a clustered environment, where I can
have multiple instances of my application and a single mySQL database to
store the scheduled jobs for the Camel routes. I want only a single instance
of my app to run when a triggered route fires. I started to follow  this
from Camel's GitHub repo in order hook my Camel routes into my clustered
Quartz scheduler. However I am confused by 2 parts of the bean declarations
given in this example. The first source of confusion is the bean declaration

<bean id="quartz2"
    <property name="scheduler" ref="scheduler"/>

The reference above to the "scheduler" bean is an instance of
org.springframework.scheduling.quartz.SchedulerFactoryBean. However the
QuartzComponent class's scheduler property is of type org.quartz.Scheduler.
Therefore, I receive a ClassCastException when trying to set scheduler
property to an instance of

My second source of confusion is the declaration of "schedulerContextAsMap"
map shown below:

<property name="schedulerContextAsMap">
        <entry key="CamelQuartzCamelContext-camelContext"

I am using Java configuration rather than XML for my bean declarations.
Therefore, should I be setting the value of the
"CamelQuartzCamelContext-camelContext" key to be an autowired instance of my

I am new to Camel/Quartz so apologies if my question is difficult to reason
about. Please let me know if you need me to provide any further information
in order to clarify my issue.



View this message in context:
Sent from the Camel - Users mailing list archive at

View raw message