You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by selva <sg...@gmail.com> on 2014/11/21 08:33:19 UTC

Quartz clustering in camel spring DSL

I am trying to achieve "requests recovery" in fail-over scenario in two
different machine with their clock also sync.

My configuration as below:

step 1: camel-context.xml

I have defined the below route in camel-context.xml file.

<route id="quartz" trace="true">

<from
uri="quartz2://cluster/quartz?cron=0+0/2+++*+?&durableJob=true&stateful=true&recoverableJob=true">

<route>

step 2: quartz.properties: I have enabled

org.quartz.jobStore.isClustered = true
org.quartz.scheduler.instanceId = AUTO
org.quartz.scheduler.instanceName =ClusteredScheduler

Currently I am running same camel application in two different instances in
my local and clustering is working fine . But when I try to test the
"requests recovery" I am getting below exception.

Exception :

[QuartzScheduler_ClusteredScheduler-camelContext-16308243724_ClusterManager]
INFO org.quartz.impl.jdbcjobstore.JobStoreTX - ClusterManager: detected 1
failed or restarted instances.

[QuartzScheduler_ClusteredScheduler-camelContext-16308243724_ClusterManager]
INFO org.quartz.impl.jdbcjobstore.JobStoreTX - ClusterManager: Scanning for
instance "6308270818"'s failed in-progress jobs.

[QuartzScheduler_ClusteredScheduler-camelContext-16308243724_ClusterManager]
INFO org.quartz.impl.jdbcjobstore.JobStoreTX - ClusterManager:
......Scheduled 1 recoverable job(s) for recovery.

[ClusteredScheduler-camelContext_Worker-1] WARN
org.apache.camel.component.quartz2.CamelJob - Cannot find existing
QuartzEndpoint with uri:
quartz2://cluster/quartz?cron=0+0%2F2+++*+%3F&durableJob=true&recoverableJob=true&stateful=true.
Creating new endpoint instance.

[ClusteredScheduler-camelContext_Worker-1] ERROR
org.apache.camel.component.quartz2.CamelJob - Failed to execute CamelJob.
org.apache.camel.ResolveEndpointFailedException: Failed to resolve endpoint:
quartz2://cluster/quartz?cron=0+0%2F2++++%3F&durableJob=true&recoverableJob=true&stateful=true
due to: Trigger key cluster.quartz is already in used by
Endpoint[quartz2://cluster/quartz?cron=0+0%2F2++++%3F&durableJob=true&recoverableJob=true&stateful=true]
at
org.apache.camel.impl.DefaultCamelContext.getEndpoint(DefaultCamelContext.java:545)
at
org.apache.camel.impl.DefaultCamelContext.getEndpoint(DefaultCamelContext.java:558)
at
org.apache.camel.component.quartz2.CamelJob.lookupQuartzEndpoint(CamelJob.java:123)
at org.apache.camel.component.quartz2.CamelJob.execute(CamelJob.java:49) at
org.quartz.core.JobRunShell.run(JobRunShell.java:202) at
org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:573)
Caused by: java.lang.IllegalArgumentException: Trigger key cluster.quartz is
already in used by
Endpoint[quartz2://cluster/quartz?cron=0+0%2F2+++*+%3F&durableJob=true&recoverableJob=true&stateful=true]
at
org.apache.camel.component.quartz2.QuartzEndpoint.ensureNoDupTriggerKey(QuartzEndpoint.java:272)
at
org.apache.camel.component.quartz2.QuartzEndpoint.addJobInScheduler(QuartzEndpoint.java:254)
at
org.apache.camel.component.quartz2.QuartzEndpoint.doStart(QuartzEndpoint.java:202)
at org.apache.camel.support.ServiceSupport.start(ServiceSupport.java:61) at
org.apache.camel.impl.DefaultCamelContext.startService(DefaultCamelContext.java:2158)
at
org.apache.camel.impl.DefaultCamelContext.doAddService(DefaultCamelContext.java:1016)
at
org.apache.camel.impl.DefaultCamelContext.addService(DefaultCamelContext.java:977)
at
org.apache.camel.impl.DefaultCamelContext.addService(DefaultCamelContext.java:973)
at
org.apache.camel.impl.DefaultCamelContext.getEndpoint(DefaultCamelContext.java:541)
... 5 more

After shutting down the instance1 which is currently excuting the job ,
instance 2 is trying to recover the job immediately but its failing to
execute the job .It is picking the same job in next interval (which is
fine).

My requirement is active node immediately recover the failed job.

Note:

camel.version=2.14.0
spring.version=3.2.8.RELEASE
quartz-2.2.1


Thanks in advance. 



--
View this message in context: http://camel.465427.n5.nabble.com/Quartz-clustering-in-camel-spring-DSL-tp5759405.html
Sent from the Camel - Users mailing list archive at Nabble.com.