0
votes

I have a requirement to use Quartz Scheduler v1.8.6 with a recent version of Spring Batch. There are legacy batch jobs that use Quartz Scheduler v1.8.6 but currently not Spring Batch.

I was able to get a simple Spring Batch job scheduled and running using Quartz Scheduler v1.8.6 with the latest Spring Batch v4.1.0 but had to add a dependency in my pom.xml to use an old version of spring-context-support v3.2.18.RELEASE. The spring-context-support provides the bridge to Quartz and v3.2.18.RELEASE was the latest version that will schedule and run a simple job in my test code.

  1. Is there documentation somewhere that lists compatible versions of Spring Batch and Quartz Scheduler?
  2. Is using an old spring-context-support in this way a completely incorrect approach?
  3. Should I use an older version of Spring Batch? I would prefer not to have to do this because the latest Spring Batch seems to have a ton of great features.
1

1 Answers

0
votes

Is there documentation somewhere that lists compatible versions of Spring Batch and Quartz Scheduler?

You can check the version of quartz in the build.gradle file of the Spring Batch version you use. For Spring batch 4.1.0, you can use quartz 2.3.0.

If you use Spring Boot, you can check start.spring.io/actuator/info to get information about spring project versions that are known to work best together when imported via Spring Boot. For example, if you generate a project with start.spring.io using Spring Boot version 2.1.0 and add spring-boot-starter-batch and spring-boot-starter-quartz starters, you will get Spring Batch 4.1.0 and Quartz 2.3.0 in your classpath.

Is using an old spring-context-support in this way a completely incorrect approach?

Not incorrect (as long as it works for you) but not recommended.

  • If you do use Spring Boot, you will get the latest spring-context version (5.1.2 in the example given above).
  • If you do not use Spring Boot, you can still import the maven BOM provided by Spring Boot and let it import the versions for you. This is better than managing the versions manually.

Should I use an older version of Spring Batch? I would prefer not to have to do this because the latest Spring Batch seems to have a ton of great features.

I don't recommend this. You can stick with v4.1.0 as you managed to get it working as you mentioned. Spring v4.x requires Java 8, so as long as the quartz version you use runs on Java 8, it will be able to schedule Spring Batch jobs.

Hope this helps.