Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add section on clustered Quartz scheduler [SPR-13649] #18225

spring-issuemaster opened this issue Nov 6, 2015 · 0 comments

Add section on clustered Quartz scheduler [SPR-13649] #18225

spring-issuemaster opened this issue Nov 6, 2015 · 0 comments


Copy link

@spring-issuemaster spring-issuemaster commented Nov 6, 2015

Andrei Ivanov opened SPR-13649 and commented

Trying to create a clustered Quartz configuration is a bit difficult since the reference documentation doesn't have any info about it and Google returns some pretty old blog posts with old versions of Spring.

What I would like to see improved:

  • section on creating a clustered scheduler.
    Something like
<bean id="taskScheduler" class="org.springframework.scheduling.quartz.SchedulerFactoryBean">
	<property name="dataSource" ref="dataSource" />
	<property name="transactionManager" ref="transactionManager" />
	<property name="taskExecutor" ref="taskExecutor" />
	<property name="overwriteExistingJobs" value="true" />
	<property name="quartzProperties">
			<prop key="org.quartz.scheduler.instanceId">AUTO</prop>
			<prop key="org.quartz.jobStore.tablePrefix">qrtz_</prop>
			<prop key="org.quartz.jobStore.isClustered">true</prop>
			<prop key="org.quartz.jobStore.useProperties">true</prop>
  • A note regarding MethodInvokingJobDetailFactoryBean that it can't be used for clustered Quartz (or even better, improve it to work)
  • A sample of a jobDetail with DI, I assume with SpringBeanJobFactory
    The way I've done this is by using @Configurable, as would make DI work on deserialization too (I've used the same approach on JSF beans)
public class UsersSyncJob extends QuartzJobBean implements Serializable {
	private transient UserFacade userFacade;

	protected void executeInternal(JobExecutionContext context) throws JobExecutionException {
  • Sample usage of SchedulerAccessorBean for when you want to register jobs/triggers from separate modules (I've discovered this nice utility by looking at the source code):
<bean class="org.springframework.scheduling.quartz.SchedulerAccessorBean">
	<property name="scheduler" ref="taskScheduler" />
	<property name="triggers">
			<ref bean="usersSyncJobTrigger" />

1 votes, 2 watchers

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
1 participant
You can’t perform that action at this time.