Get ahead
VMware offers training and certification to turbo-charge your progress.
Learn moreOn behalf of the team and everyone who has contributed, I am pleased to announce that Spring Batch 5.1.0-M3 is now available from our milestone repository.
This new milestone introduces the following main features:
JobRegistryBeanPostProcessor
JobKeyGenerator
For the complete list of changes, please check the release notes.
This milestone release upgrades Spring dependencies to the following versions:
A typical case of using Redis within the context of Spring Batch is populating/clearing a cache with reference data before/after a job execution. This is a common performance improvement pattern that is useful to query data from the cache instead of issuing multiple queries to the main database during the execution of the job.
In this milestone release, a new RedisItemReader
and RedisItemWriter
based on Spring Data Redis have been introduced in the library of built-in item readers and writers. The reader can be configured with a ScanOptions
to scan the key set to read from Redis. The writer is configurable with a RedisTemplate
to write items to Redis.
When configuring a JobOperator
in a Spring Batch application, it is necessary to register the jobs in the operator's JobRegistry
. This registration process is either done manually or automatically by adding a JobRegistryBeanPostProcessor
bean to the application context.
In this milestone release, the default configuration of Spring Batch (ie when using @EnableBatchProcessing
or extending DefaultBatchConfiguration
) now automatically registers a JobRegistryBeanPostProcessor
bean in the application context. This simplifies the configuration process and improves the user experience when using a JobOperator
.
When using the XML configuration style, it is possible to start a job flow with a decider thanks to the decision
element. However, up to version 5.0, it was not possible to achieve the same flow definition with the Java API.
This milestone release adds a new option to the JobBuilder
API to start a job flow with a JobExecutionDecider
. This makes both configuration styles more consistent.
By default, Spring Batch identifies job instances by calculating a hash of the identifying job parameters. While it is unlikely to need to customize this identification process, Spring Batch still provides a strategy interface for users to override the default mechanism through the JobKeyGenerator
API.
Up to version 5.0, it was not possible to provide a custom key generator without having to create a custom JobRepository
and JobExplorer
. In this version, it is now possible to provide a custom JobKeyGenerator
through the factory beans of JobRepository
and JobExplorer
.
The reference documentation was updated to use Antora. This update introduces a number of improvements, including but not limited to:
You can check the new documentation version here.
First, I would like to thank all contributors who had a role in this release! You can try Spring Batch 5.1.0-M3 with Spring Boot 3.2.0-M3. We are planning to release Spring Batch 5.1 GA later this November 2023.
We look forward to your feedback on Github Issues, Github Discussions, Twitter, and StackOverflow.
I would like to remind our users that Spring Batch 4.3.x will be out of OSS support on November, 18th 2023. Please consider upgrading your applications to Spring Batch 5 at your earliest convenience. You can find the migration guide to v5 here.
Feel free to reach out to the Spring Batch team on Github if you need help on migrating your existing applications to Spring Batch 5!