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 the first milestone of Spring Batch 5.2 is now available from our milestones repository. This blog post walks you through the main changes in Spring Batch 5.2:
RecursiveCollectionLineAggregator
For the complete list of changes, please check the release notes.
In this release, the Spring dependencies are upgraded to the following versions:
Up until version 5.1, the JPA cursor and paging item readers did not support query hints (like the fetch size, timeout, etc). Users were required to provide a custom query provider in order to specify custom hints.
In this release, JPA readers and their respective builders were updated to accept query hints when defining the JPA query to use.
This release introduces a new method in the builders of JDBC cursor and paging item readers that allows users to specify a DataClassRowMapper
when the type of items is a data class (Java record or Kotlin data class).
The new method named dataRowMapper(TargetType.class)
is similar to the beanRowMapper(TargetType.class)
and is designed to make the configuration of row mappers consistent between regular classes (Java beans) and data classes (Java records).
Up until now, the line separator property in RecursiveCollectionLineAggregator
was set to the System's line separator value. While it is possible to change the value through a System property, this configuration style is not consistent with other properties of batch artifacts.
This release introduces a new setter in RecursiveCollectionLineAggregator
that allows users to configure a custom value of the line separator without having to use System properties.
In version 5.1, the default configuration of batch infrastructure beans was updated to automatically populate the job registry by defining a JobRegistryBeanPostProcessor
bean in the application context. After a recent update in Spring Framework that changed the log level in BeanPostProcessorChecker
, several warnings related to the JobRegistryBeanPostProcessor
were logged in a typical Spring Batch application. These warnings are due to the JobRegistryBeanPostProcessor
bean having a dependency to a JobRegistry
bean, which is not recommended and might cause bean lifecycle issues.
These issues have been resolved in this release by changing the mechanism of populating the JobRegistry
from using a BeanPostProcessor
to using a SmartInitializingSingleton
. The JobRegistryBeanPostProcessor
is now deprecated in favor of the newly added JobRegistrySmartInitializingSingleton
.
I would like to thank all contributors who had a role in this release! Spring Batch 5.2.0-M1 comes with Spring Boot 3.4.0-M3.
We look forward to your feedback on Github Issues, Github Discussions, Twitter, and StackOverflow.