You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by Cédric Pineau <ce...@gmail.com> on 2011/09/06 16:39:59 UTC
Quartz stateful job routes not recreated on server restart
Hi to all.
I use quartz stateful job with a jdbcstore.
Everything works fine as long as the server is not shutdown : the job is
running, its state is persisted.
But on server restart, the jobs are not running anymore, no exception in
trace, no nothing :-/
Still I get this trace on startup, indicating that a persisted job has been
found :
[INFO] core.QuartzScheduler Scheduler meta-data: Quartz Scheduler (v1.8.4)
'BabelScheduler' with instanceId 'okinawa1315316176852'
Scheduler class: 'org.quartz.core.QuartzScheduler' - running locally.
NOT STARTED.
Currently in standby mode.
Number of jobs executed: 0
Using thread pool 'org.quartz.simpl.SimpleThreadPool' - with 25 threads.
Using job-store 'org.quartz.impl.jdbcjobstore.JobStoreTX' - which supports
persistence. and is clustered.
[INFO] impl.StdSchedulerFactory Quartz scheduler 'BabelScheduler'
initialized from an externally provided properties instance.
[INFO] impl.StdSchedulerFactory Quartz scheduler version: 1.8.4
[INFO] quartz.QuartzComponent Starting Quartz scheduler: BabelScheduler
[INFO] jdbcjobstore.JobStoreTX ClusterManager: detected 1 failed or
restarted instances.
[INFO] jdbcjobstore.JobStoreTX ClusterManager: Scanning for instance
"okinawa1315315888193"'s failed in-progress jobs.
[INFO] core.QuartzScheduler Scheduler BabelScheduler_$_okinawa1315316176852
started.
[INFO] jdbcjobstore.JobStoreTX Handling 1 trigger(s) that missed their
scheduled fire-time.
I also do find the loaded job on quartz scheduler, nothing to note here,
expect that the job is not 'durable'. Is this important ?
(www.quartz-scheduler.org seems down)
Has anyone any tips about this ? Thanks in advance !
--
View this message in context: http://camel.465427.n5.nabble.com/Quartz-stateful-job-routes-not-recreated-on-server-restart-tp4774630p4774630.html
Sent from the Camel - Users mailing list archive at Nabble.com.
Re: Quartz stateful job routes not recreated on server restart
Posted by Cédric Pineau <ce...@gmail.com>.
I think the problem is that we don't use static builders but creates our
routes dynamically.
The quartz component fires events correctly :
[DEBUG] simpl.SimpleJobFactory Producing instance of Job
'DEFAULT.quartz-endpoint20',
class=org.apache.camel.component.quartz.StatefulCamelJob
[DEBUG] core.JobRunShell Calling execute on job DEFAULT.quartz-endpoint20
[DEBUG] quartz.QuartzEndpoint Firing Quartz Job with context:
JobExecutionContext: trigger:
'BabelScheduler.03862e89-e8e7-410b-af9e-51653ce674d4 job:
DEFAULT.quartz-endpoint20 fireTime: 'Wed Sep 07 10:57:11 CEST 2011
scheduledFireTime: Wed Sep 07 10:57:11 CEST 2011 previousFireTime: 'Wed Sep
07 10:56:11 CEST 2011 nextFireTime: Wed Sep 07 10:58:11 CEST 2011
isRecovering: false refireCount: 0
But they are not consumed by any route :-/
So we have to rebuild our consuming routes at statup for the quartz events
endpoints in the store !
Any comments welcome on all this.
--
View this message in context: http://camel.465427.n5.nabble.com/Quartz-stateful-job-routes-not-recreated-on-server-restart-tp4774630p4777840.html
Sent from the Camel - Users mailing list archive at Nabble.com.
Re: Quartz stateful job routes not recreated on server restart
Posted by Cédric Pineau <ce...@gmail.com>.
Hi Willem.
I'm using camel 2.8.0
My quartz settings are as follow :
<bean id="quartz"
class="org.apache.camel.component.quartz.QuartzComponent">
<property name="propertiesFile" value="quartz.properties"/>
</bean>
and
#============================================================================
org.quartz.scheduler.instanceName = BabelScheduler
org.quartz.scheduler.instanceId = AUTO
#============================================================================
org.quartz.threadPool.class = org.quartz.simpl.SimpleThreadPool
org.quartz.threadPool.threadCount = 25
org.quartz.threadPool.threadPriority = 5
#============================================================================
org.quartz.jobStore.misfireThreshold = 60000
org.quartz.jobStore.class = org.quartz.impl.jdbcjobstore.JobStoreTX
org.quartz.jobStore.driverDelegateClass =
org.quartz.impl.jdbcjobstore.StdJDBCDelegate
org.quartz.jobStore.useProperties = false
org.quartz.jobStore.dataSource = babelDS
org.quartz.jobStore.tablePrefix = qrtz_
org.quartz.jobStore.isClustered = true
org.quartz.jobStore.clusterCheckinInterval = 20000
org.quartz.dataSource.babelDS.jndiURL=java:comp/env/jdbc/babel
The general route is :
from(endpoint(QUARTZ)).routeId(getName())
.processRef(BabelConstants.JOB_EXECUTION_PROCESSOR)
.setExchangePattern(ExchangePattern.InOnly)
.to(endpoint(QUARTZ_OUT));
The processor is used to build a request that is post via the QUARTZ_OUT
endpoint to a REST entry point of another route. My testing crons are set to
fire every minutes : 0 * * ? * *
What I noticed is that my quartz component is not auto launched at spring
startup (even tring to explicitly set <property name="autoStartScheduler"
value="true"/> in its spring conf), i have to instantiate another quartz
route for the component to go up and read its store content
(jdbcjobstore.JobStoreTX Handling 2 trigger(s) that missed their scheduled
fire-time) but still it does nothing with them (the processor is never
reached by a thread).
Cédric
--
View this message in context: http://camel.465427.n5.nabble.com/Quartz-stateful-job-routes-not-recreated-on-server-restart-tp4774630p4777722.html
Sent from the Camel - Users mailing list archive at Nabble.com.
Re: Quartz stateful job routes not recreated on server restart
Posted by Willem Jiang <wi...@gmail.com>.
Which version of Camel are you using ?
Can you post the related camel route and quartz setting to this thread?
It will be helpful for us to trace the issue.
On Tue Sep 6 22:39:59 2011, Cédric Pineau wrote:
> Hi to all.
>
> I use quartz stateful job with a jdbcstore.
> Everything works fine as long as the server is not shutdown : the job is
> running, its state is persisted.
>
> But on server restart, the jobs are not running anymore, no exception in
> trace, no nothing :-/
> Still I get this trace on startup, indicating that a persisted job has been
> found :
> [INFO] core.QuartzScheduler Scheduler meta-data: Quartz Scheduler (v1.8.4)
> 'BabelScheduler' with instanceId 'okinawa1315316176852'
> Scheduler class: 'org.quartz.core.QuartzScheduler' - running locally.
> NOT STARTED.
> Currently in standby mode.
> Number of jobs executed: 0
> Using thread pool 'org.quartz.simpl.SimpleThreadPool' - with 25 threads.
> Using job-store 'org.quartz.impl.jdbcjobstore.JobStoreTX' - which supports
> persistence. and is clustered.
>
> [INFO] impl.StdSchedulerFactory Quartz scheduler 'BabelScheduler'
> initialized from an externally provided properties instance.
> [INFO] impl.StdSchedulerFactory Quartz scheduler version: 1.8.4
> [INFO] quartz.QuartzComponent Starting Quartz scheduler: BabelScheduler
> [INFO] jdbcjobstore.JobStoreTX ClusterManager: detected 1 failed or
> restarted instances.
> [INFO] jdbcjobstore.JobStoreTX ClusterManager: Scanning for instance
> "okinawa1315315888193"'s failed in-progress jobs.
> [INFO] core.QuartzScheduler Scheduler BabelScheduler_$_okinawa1315316176852
> started.
> [INFO] jdbcjobstore.JobStoreTX Handling 1 trigger(s) that missed their
> scheduled fire-time.
>
> I also do find the loaded job on quartz scheduler, nothing to note here,
> expect that the job is not 'durable'. Is this important ?
> (www.quartz-scheduler.org seems down)
>
> Has anyone any tips about this ? Thanks in advance !
>
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/Quartz-stateful-job-routes-not-recreated-on-server-restart-tp4774630p4774630.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>
--
Willem
----------------------------------
FuseSource
Web: http://www.fusesource.com
Blog: http://willemjiang.blogspot.com (English)
http://jnn.javaeye.com (Chinese)
Twitter: willemjiang
Weibo: willemjiang