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.0.0-M4 is now available from our milestone repository.
This fourth milestone introduces several improvements for Java Records support. It also comes with a number of enhancements, bug fixes, dependency upgrades, and documentation updates. For more details about all the changes, see the release notes.
The support for Java records as items in a chunk-oriented step was initially introduced in v4.3, but that support was limited, due to the fact that v4 has Java 8 as a baseline. In Java 8, records were not even in preview yet. That initial support was based on reflection tricks to create Java records and populate them with data, without having access to the java.lang.Record
API, which was finalized in Java 16.
Now that v5 has Java 17 as a baseline, we have improved records support in Spring Batch by leveraging the java.lang.Record
API in different parts of the framework. For example, the FlatFileItemReaderBuilder
is now able to detect if the item type is a record or a regular class and configure the corresponding FieldSetMapper
implementation accordingly (RecordFieldSetMapper
for records and BeanWrapperFieldSetMapper
for regular classes). The goal here is to make the configuration of the required FieldSetMapper
type transparent to the user. The same feature has also been implemented in the FlatFileItemWriterBuilder
, in order to configure either a RecordFieldExtractor
or a BeanWrapperFieldExtractor
based on the item type.
Some bugs cannot be fixed without introducing breaking changes. We take the opportunity of this major release to fix such bugs. In this milestone, the following major bugs were fixed:
spring-tx
in the classpath #4132StepBuilder
#3686ItemReadListener
not being correctly registered after adding a StepExecutionListener
#773final class com.sun.proxy.$Proxy202
#793StepBuilderFactory
only Supports Listener Annotations, not Listener Interfaces #1098This is not an exhaustive list. See the release notes for the complete list of bugs that were fixed in this milestone.
Major dependencies have been upgraded to the following versions:
I would like to thank all contributors who had a role in this release! As we continue our work on Spring Batch 5, we look forward to your feedback on Github, Twitter, and StackOverflow.