On behalf of the Spring Batch team, I am pleased to announce that Spring Batch 4.3.0-M1 is now available from our milestone repository.

What’s new?

This release is packed with new features, performance improvements, and bug fixes, as well as documentation and dependency updates! You can find the complete list of changes in the release notes, but here are the major highlights:

New features

1. New synchronized ItemStreamWriter

Similar to the SynchronizedItemStreamReader, we added a SynchronizedItemStreamWriter. This feature is useful in multi-threaded steps where concurrent threads need to be synchronized to not override each other’s writes.

2. Add support for named queries in JpaPagingItemReader

Up until now, it was possible to use named queries with the JpaPagingItemReader. However, this required the creation of a custom query provider, as follows:

JpaPagingItemReader<Foo> reader = new JpaPagingItemReaderBuilder<Foo>()
    .name("fooReader")
    .queryProvider(new AbstractJpaQueryProvider() {
       @Override
       public Query createQuery() {
          return getEntityManager().createNamedQuery("allFoos", Foo.class);
       }

       @Override
       public void afterPropertiesSet() throws Exception {
       }
    })
    // set other properties on the reader
    .build();
COPY

In this release, we introduced a JpaNamedQueryProvider next to the JpaNativeQueryProvider

to ease the configuration, which can now be written like this:

JpaPagingItemReader<Foo> reader = new JpaPagingItemReaderBuilder<Foo>()
		.name("fooReader")
		.queryProvider(new JpaNamedQueryProvider("allFoos", Foo.class))
		// set other properties on the reader
		.build();

#spring

Spring Batch 4.3.0-M1 is released now!
2.65 GEEK