I have a Java application which utilises Quartz 1.6.6. It is deployed onto Weblogic, the architecture of which includes two application servers.
The application includes a trigger process which runs regularly - once a minute. This is achieved using Spring 3.1.1 (with a org.springframework.scheduling.quartz.SchedulerFactoryBean).
I have included a quartz.properties file in the Java application's EAR file with a hope to be able to utilise Quartz's clustering facilities so that the application servers would synchronise themselves in order that the job is only run once per minute. However, on looking at the application log, it's obvious to see that from the messages produced, there are still two jobs being run every 60 seconds - one a few seconds behind the other.
The confusing this is that I have another Java application into which I have included Quartz scheduling and it seems to be working quite happily. This other application has an identical mechanism for firing a trigger every minute and from the logs I can see that the job is only being run once every 60 seconds.
Examples of times yesterday afternoon that the job has run:
15:10:46,984 15:10:49,583 15:11:46,961 15:11:49,561
Here's my quartz.properties file:
org.quartz.scheduler.instanceName=QuartzClusteredScheduler
org.quartz.scheduler.instanceId=AUTO
org.quartz.threadPool.class=org.quartz.simpl.SimpleThreadPool
org.quartz.threadPool.threadCount=5
org.quartz.dataSource.dbDS.driver=oracle.jdbc.driver.OracleDriver
org.quartz.dataSource.dbDS.URL=jdbc:oracle:thin:@MY_DB:1521:my_sid
org.quartz.dataSource.dbDS.user=username
org.quartz.dataSource.dbDS.password=password
org.quartz.dataSource.dbDS.maxConnections=5
org.quartz.jobStore.class=org.quartz.impl.jdbcjobstore.JobStoreTX
org.quartz.jobStore.driverDelegateClass=org.quartz.impl.jdbcjobstore.StdJDBCDelegate
org.quartz.jobStore.isClustered=true
org.quartz.jobStore.dataSource=dbDS
org.quartz.jobStore.tablePrefix=QRTZ_
I have had a look in the database at the Quartz-specific tables but there is no data at all in them, which would lead me to think that the properties file isn't being picked up for some reason. I can't see why, though, as I have included quartz.properties in the EAR file under WEB-INF/classes in the WAR.
Thanks in advance for any assistance.
could you see, in your logs, when your quartz scheduler started, such output :
That would indicate that your quartz.properties is used and the JobStoreTX is chosen as the jobstore.
I have utilised the workaround: include the properties within the SchedulerFactoryBean definition within my application context XML file, instead of using quartz.properties.