I have a couple of Java applications that utilise Quartz 1.6.6 upon Weblogic with Spring (one uses Spring v. 2.5.4; the other uses Spring v. 3.1.1). My architecture has two application servers in the Weblogic cluster.
Both applications have simple triggers set up (using org.springframework.scheduling.quartz.SchedulerFactoryBean, org.springframework.scheduling.quartz.SimpleTriggerBean and org.springframework.scheduling.quartz.JobDetailBean). They are all set to run every 60 seconds.
I have added logging to the associated org.springframework.scheduling.quartz.QuartzJobBean (at the start of the executeInternal() method) which writes the time of when the process gets executed.
What I have found is that the time is inconsistent – sometimes the execution for a given minute will not happen. Examples:
Application 1 has one trigger process which was executed at the following times:
14:26:26,098
14:28:26,089
14:31:26,096
14:33:26,093
14:35:26,095
14:36:26,098
14:38:26,103
Application 2 has two trigger processes which were executed at the following times:
14:40:05,951 (trigger 1)
14:41:05,951 (trigger 2)
14:42:05,943 (trigger 1)
14:43:05,954 (trigger 2)
14:44:05,937 (trigger 1)
14:45:05,956 (trigger 2)
14:46:05,953 (trigger 2)
14:47:05,937 (trigger 1)
14:48:05,941 (trigger 1)
14:49:05,939 (trigger 1)
14:50:05,951 (trigger 2)
If I switch one Weblogic application server off, then both applications quite happily run all their jobs each and every minute.
I have checked the database tables for all the jobs and QRTZ_SIMPLE_TRIGGERS.REPEAT_INTERVAL is correct (60,000 milliseconds). The difference between QRTZ_TRIGGERS.PREV_FIRE_TIME and QRTZ_TRIGGERS.NEXT_FIRE_TIME is also 60,000.
My quartzProperties definition in the application context file has the following entries:
<property name="quartzProperties">
<props>
<prop key="org.quartz.scheduler.instanceName">MyClusteredScheduler</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">5</prop>
<prop key="org.quartz.jobStore.class">org.quartz.impl.jdbcjobstore.JobStoreTX</prop>
<prop key="org.quartz.jobStore.driverDelegateClass">org.quartz.impl.jdbcjobstore.StdJDBCDelegate</prop>
<prop key="org.quartz.jobStore.isClustered">true</prop>
<prop key="org.quartz.jobStore.clusterCheckinInterval">5000</prop>
<prop key="org.quartz.jobStore.dataSource">myDS</prop>
<prop key="org.quartz.jobStore.tablePrefix">QRTZ_</prop>
<prop key="org.quartz.dataSource.myDS.driver">oracle.jdbc.driver.OracleDriver</prop>
<prop key="org.quartz.dataSource.myDS.URL">{db connection string}</prop>
<prop key="org.quartz.dataSource.myDS.user">{username}</prop>
<prop key="org.quartz.dataSource.myDS.password">{password}</prop>
<prop key="org.quartz.dataSource.myDS.maxConnections">5</prop>
<prop key="org.quartz.dataSource.myDS.validationQuery">select 0 from dual</prop>
</props>
</property>
Any thoughts upon why this should be? Thanks in advance.
Seemingly fixed: the issue was more to do with the reliance on inconsistent logging messages to suggest inconsistent trigger times than anything to do with Quartz.