You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by dkum003 <DH...@amadeus.com> on 2013/08/01 16:28:16 UTC

Re: Camel JPA - Clustered Deployment - Quartz Scheduling

Hi Patrick,

Yes i do have.

I am trying to achieve the same. I did the following changes

1. Quartz.properties in my resource bundle with
org.quartz.jobStore.isClustered = true

2. Made DB entries.

3. This is my route builder - 
QuartzComponent component = new QuartzComponent();
component.setPropertiesFile("quartz.properties");
getContext().addComponent("quartz", component);

We are using CronScheduledRoutePolicy to start the routes.

Everything works fine. When the routes are deployed in a clustered
environment of 2 servers, 2 entries are made in the quartz tables. The route
starts alternatively, but at times i get this error 

Job threw an unhandled exception. [See nested exception:
java.lang.NullPointerException]
        at org.quartz.core.JobRunShell.run(JobRunShell.java:213)
        at
org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:529)
Caused by: java.lang.NullPointerException
        at
org.apache.camel.routepolicy.quartz.ScheduledJob.execute(ScheduledJob.java:42)
        at org.quartz.core.JobRunShell.run(JobRunShell.java:202)
        ... 1 more

This does not start the job in both the servers




--
View this message in context: http://camel.465427.n5.nabble.com/Camel-JPA-Clustered-Deployment-Quartz-Scheduling-tp5733292p5736642.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Camel JPA - Clustered Deployment - Quartz Scheduling

Posted by dkum003 <DH...@amadeus.com>.
Hi,

I feared this.

Do you by any chance have working example which uses
CronScheduledRoutePolicy and supports clustering ?

This would be very helpful.

Regards,
Manish 



--
View this message in context: http://camel.465427.n5.nabble.com/Camel-JPA-Clustered-Deployment-Quartz-Scheduling-tp5733292p5736811.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Camel JPA - Clustered Deployment - Quartz Scheduling

Posted by gquintana <ge...@gmail.com>.
I find it strange to have N rows in Quartz tables for N cluster nodes. You
should have one row per route x action on route. I imagine that if you
schedule the same action for the same route on 2 different cluster nodes,
sometimes one cluster node will try to execute the Job scheduler by the
other node: as Camel is storing ScheduledJobState in memory, then it's null
it this case. I wonder why Camel is not storing this ScheduledJobState among
JobParams (it's only a route + action), they would be persisted and shared
by all nodes.



--
View this message in context: http://camel.465427.n5.nabble.com/Camel-JPA-Clustered-Deployment-Quartz-Scheduling-tp5733292p5736660.html
Sent from the Camel - Users mailing list archive at Nabble.com.