camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From selva <>
Subject Re: Quartz clustering in camel spring DSL - JIRA CAMEL-8076
Date Wed, 26 Nov 2014 05:08:22 GMT
Hi Willem,

I have defined one quartz2 endpoint route and one sub route in
camel-context.xml file . Whenever the quartz scheduler triggers , the quartz
end point will call the sub route using direct component. I am printing some
text in console using bean processor(QueryBuilderProcessor) which is defined
in sub route.

<bean id="QueryBuilderProcessor"
class="cluster.quartz.QueryBuilderProcessor" />
<route id="quartz" trace="true">
                        <to uri="direct:queryProcessor" />//calling sub rout

<route id="queryProcessor" startupOrder="1">
                        <from uri="direct:queryProcessor" />
                        <to uri="bean:QueryBuilderProcessor" />

My cluster configuration: 
I have followed below Link to set up Clustering  with the JDBC-Jobstore.
I have file in  resource folder like

org.quartz.scheduler.instanceName = ClusteredScheduler
org.quartz.scheduler.instanceId = AUTO
org.quartz.jobStore.isClustered = true
org.quartz.plugin.triggerHistory.triggerFiredMessage=Trigger [{1}.{0}] fired
job [{6}.{5}] scheduled at: {2, date, dd-MM-yyyy HH:mm:ss.SSS}, next
scheduled at: {3, date, dd-MM-yyyy HH:mm:ss.SSS}
org.quartz.plugin.triggerHistory.triggerCompleteMessage=Trigger [{1}.{0}]
completed firing job [{6}.{5}] with resulting trigger instruction code: {9}.
Next scheduled at: {3, date, dd-MM-yyyy HH:mm:ss.SSS}
org.quartz.plugin.triggerHistory.triggerMisfiredMessage=Trigger [{1}.{0}]
misfired job [{6}.{5}]. Should have fired at: {3, date, dd-MM-yyyy
org.quartz.plugin.jobHistory.jobToBeFiredMessage=Job [{1}.{0}] to be fired
by trigger [{4}.{3}], re-fire: {7}
org.quartz.plugin.jobHistory.jobSuccessMessage=Job [{1}.{0}] execution
complete and reports: {8}
org.quartz.plugin.jobHistory.jobFailedMessage=Job [{1}.{0}] execution failed
with exception: {8}
org.quartz.plugin.jobHistory.jobWasVetoedMessage=Job [{1}.{0}] was vetoed.
It was to be fired by trigger [{4}.{3}] at: {2, date, dd-MM-yyyy

public void process(Exchange exchange) throws Exception {"Started");
		System.out.println(****processor started******");
		System.out.println(****processor Ends******);

Test case:

  I am running the same camel application as standalone using
org.apache.camel.spring.Main class in two eclipse instance in same machine,
So by default clock is sync.
  Two Node: 
  1. Eclipse Instance 1:(Node1) First I am starting application from eclipse
instance 1 , based on quartz properties file Quartz tables are    populated
with the job details.

  2.Eclipse Instance 2:(Node2) I am  starting same application from eclipse
instance 2.

Both instance are started and could see their scheduler entries (Node1 &
Node2) in qrtz_scheduler_state table.

Stopping Job:

Constantly I watching  the TRIGGER_STATE column of job in  *qrtz_triggers*
table & console for two camel application. 

step1 : Initially Trigger state will be "WAITING"
stept2: Once the Trigger state changed to "AQUIRED" , I go back to console
find the which node picked the job.
step3: Assume  ****processor started******" printed  from and Immediately terminate the Node1 by
clicking terminate button in eclipse.
step4: Now current TRIGGER state is "BLOCKED".
step5: I could see the recovery logs in Node2 console.(Which is mentioned in
the above question). 

*My doubt is , if you see the Recovering job trigger details in
*qrtz_triggers* table above question, TRIGGER_TYPE is SIMPLE, but we defined
in our route is CRON type*.

Please refer the section "*Captured in qrtz_triggers table*" in above

I think the problem is CRON type, Recovery Job Tigger type should be CRON


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

View raw message