Spring Batch 5.0.0-M4 available now!

Releases | Mahmoud Ben Hassine | July 20, 2022 | ...

On 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.

Java Records Support Improvement

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.

Bug fixes

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:

  • Unable to read XML data without spring-tx in the classpath #4132
  • Lost transaction attributes when using a chaining StepBuilder #3686
  • ItemReadListener not being correctly registered after adding a StepExecutionListener #773
  • Cannot subclass final class com.sun.proxy.$Proxy202 #793
  • StepBuilderFactory only Supports Listener Annotations, not Listener Interfaces #1098

This is not an exhaustive list. See the release notes for the complete list of bugs that were fixed in this milestone.

Dependency Upgrades

Major dependencies have been upgraded to the following versions:

  • Upgrade to Spring Framework 6.0.0-M5
  • Upgrade to Spring Data 2022.0.0-M5
  • Upgrade to Spring Integration 6.0.0-M4
  • Upgrade to Spring AMQP 3.0.0-M3
  • Upgrade to Spring for Apache Kafka 3.0.0-M5
  • Upgrade to Micrometer 1.10.0-M3
  • Upgrade to Hibernate 6.1.1.Final


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.

Spring Batch Home|Source on Github|Reference documentation

Get the Spring newsletter

Thank you!

Get ahead

VMware offers training and certification to turbo-charge your progress.

Learn more

Get support

Spring Runtime offers support and binaries for OpenJDK™, Spring, and Apache Tomcat® in one simple subscription.

Learn more

Upcoming events

Check out all the upcoming events in the Spring community.

View all