This version is still in development and is not considered stable yet. For the latest stable version, please use Spring Batch Documentation 5.1.2! |
This version is still in development and is not considered stable yet. For the latest stable version, please use Spring Batch Documentation 5.1.2! |
This section highlights the major changes in Spring Batch 5.2. For the complete list of changes, please refer to the release notes.
Spring Batch 5.2 includes the following features:
Dependencies upgrade
In this release, the Spring dependencies are upgraded to the following versions:
-
Spring Framework 6.2.0
-
Spring Integration 6.4.0
-
Spring Data 3.4.0
-
Spring Retry 2.0.9
-
Spring LDAP 3.2.7
-
Spring AMQP 3.2.0
-
Spring Kafka 3.3.0
-
Micrometer 1.14.0
Query hints support in JPA item readers
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.
Data class support in JDBC item readers
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).
Configurable line separator in RecursiveCollectionLineAggregator
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.
Job registration improvements
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 change 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
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
.