Engineering
Releases
News and Events

Spring Batch 4.0.0.M3 is now available

We are pleased to announce that Spring Batch 4.0.0.M3 is now available via Github and the Pivotal download repository. This release represents the third milestone for the Spring Batch 4.0 release. Many thanks to all that contributed to this release.

What’s new?

This milestone continues the work laid out in the previous 4.0.0 milestones. Specific updates include:

  • Dependency updates
  • Continued java configuration improvements
  • Intial updates to documentation

Dependency updates

As the dependency graph of Spring Boot 2 evolves, we have been updating our dependencies to be in line with them. This includes the updating of Spring Data Kay and Spring Integraiton 5 dependencies as well as removing support for Log4J 1.x in favor of the newer 2.x line.

Java Configuration

Continuing the story of improving the java configuration capabilities in the previous milestones, all ItemReader and ItemWriter implementations provided by Spring Batch now have builder implementations to simplify their configuration. These new builders allow you to take configuration that looked like this in XML:

<bean id="mongoItemReader" 
	class="org.springframework.batch.item.data.MongoItemReader" 
	scope="step">
	<property name="name" value="mongoItemReader" />
	<property name="template" ref="mongoTemplate" />
	<property name="targetType" value="String" />
	<property name="query"
		value="{ }" />
	<property name="sort">
		<util:map id="sort">
			<entry key="id" value="DESC" />
		</util:map>
	</property>
</bean>

Or this whith the old java config:

@Bean
public MongoItemReader<String> mongoItemReader() {
	MongoItemReader<String> reader = 
		new MongoItemReader<>();

	reader.setName("mongoItemReader")
	reader.setTemplate(this.template);
	reader.setTargetType(String.class);
	reader.setQuery("{ }");
	reader.setSort(this.sortOptions);

	return reader;
}

To this using our new 4.0 builders:

@Bean
public MongoItemReader<String> mongoItemReader() {
	return new MongoItemReaderBuilder<String>().template(this.template)
			.targetType(String.class)
			.query("{ }")
			.sorts(this.sortOptions)
			.name("mongoItemReader")
			.build();
}

Updates to documentation

One of the major themes for the Spring Batch 4 release is modernizing the reference documentation. This release includes the first step in that modernization effort in that we moved from docbooks to AsciiDoc. In the next milestone we’ll begin to focus on making java config a first class citizen in the Spring Batch reference documentation.

What’s next?

Looking out to the next milestone, we’ll continue to pick up the milestones and releases of our related Spring dependencies (Spring Framework 5, Spring Data Kay, and Spring Integration 5). We’ll also begin to deep dive into the effort around making the documentation “java config first”.

Spring Batch Admin End of Life

We want to take a minute today to also announce that the Spring Batch Admin project will be moving into the Spring Attic with an end of life date to be December 31, 2017. The functionality of Spring Batch Admin has been mostly duplicated and expanded upon via Spring Cloud Data Flow and we encourage all users to migrate to that going forward. Documentation on that migration process can be found in the Spring Batch Admin Github repository here.

What do you think?

We look forward to your feedback on these new features in Jira, StackOverflow, or to me directly via Twitter @michaelminella!

Spring Batch Home | Source on GitHub | Reference Documentation

comments powered by Disqus