Quartz scheduler: clustering - job executing twice
楼主#更多 发布于：2016-05-16 10:53
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
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.
I have utilised the workaround: include the properties within the SchedulerFactoryBean definition within my application context XML file, instead of using quartz.properties.