Quartz Scheduler Errors

We learned this week what this error message meant for us:

org.quartz.impl.jdbcjobstore.JobStoreTX.recoverMisfiredJobs [] Handling 1 trigger(s) that missed their scheduled fire-time.

This was happening because we had more jobs configured to run at certain time than we had threads configured to run.

We changed the spring servlet configuration file to specify more threads and more datasource connections.

<bean class="org.springframework.scheduling.quartz.SchedulerFactoryBean">
 <property name="triggers">
 <list>
 <ref bean="somethingTrigger" />
 <ref bean="something2Trigger" />
 <ref bean="something3Trigger" />
</list>
</property>
<property name="applicationContextSchedulerContextKey"><value>applicationContext</value></property>
 <property name="overwriteExistingJobs"><value>true</value></property>
 <property name="quartzProperties">
 <props>
 <prop key="org.quartz.scheduler.instanceName">InstanceNameX</prop>
 <prop key="org.quartz.scheduler.instanceId">AUTO</prop>
 <prop key="org.quartz.threadPool.class">org.quartz.simpl.SimpleThreadPool</prop>
 <prop key="org.quartz.threadPool.threadCount">20</prop>
 <prop key="org.quartz.threadPool.threadPriority">5</prop>
 <prop key="org.quartz.jobStore.misfireThreshold">60000</prop>
 <prop key="org.quartz.jobStore.class">org.quartz.impl.jdbcjobstore.JobStoreTX</prop>
 <prop key="org.quartz.jobStore.driverDelegateClass">org.quartz.impl.jdbcjobstore.PostgreSQLDelegate</prop>
 <prop key="org.quartz.jobStore.useProperties">false</prop>
 <prop key="org.quartz.jobStore.dataSource">myDS</prop>
 <prop key="org.quartz.jobStore.tablePrefix">QRTZ_</prop>
 <prop key="org.quartz.jobStore.isClustered">true</prop>
 <prop key="org.quartz.jobStore.clusterCheckinInterval">20000</prop>
 <prop key="org.quartz.dataSource.myDS.driver">${db.driver}</prop>
 <prop key="org.quartz.dataSource.myDS.URL">${db.url}</prop>
 <prop key="org.quartz.dataSource.myDS.user">${db.username}</prop>
 <prop key="org.quartz.dataSource.myDS.password">${db.password}</prop>
 <prop key="org.quartz.dataSource.myDS.maxConnections">23</prop>
 <prop key="org.quartz.dataSource.myDS.validationQuery">select 1</prop>
 </props>
 </property>
 </bean>

We have not seen the error since we have made these changes.

It also means that we will have to increase the number of thread as we have more bean scheduled with Quartz.

Advertisements

Published by

m5c

Java developper that loves photography and good coffee

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

w

Connecting to %s