Inject application context dependencies in Quartz job beans

The SpringBeanJobFactory allows you to inject properties from the scheduler context, job data map and trigger data entries into the job bean. But there is no way out of the box to inject beans from the application context.

So I came up with the factory bean below that extends the SpringBeanJobFactory to add auto-wiring support:

5 thoughts on “Inject application context dependencies in Quartz job beans

  1. Pingback: Scheduling in Spring with Quartz | Baeldung

    • To be honest it’s so long since I wrote this code and used Quartz in a project that I couldn’t tell you my original reasoning for making it transient.

  2. Thanks a lot for this class. SpringBoot add a new class AutowireCapableBeanJobFactory that does this job, with a comment that reference your blog.

Leave a Reply

Your email address will not be published. Required fields are marked *