Spring Batch 2.2.0.RELEASE is now available

Releases | Josh Long | June 06, 2013 | ...

We are pleased to announce that Spring Batch 2.2.0.RELEASE is now available via Maven Central, Github and the SpringSource download repository.

Spring Batch Home | Source on GitHub | Reference Documentation

Support for Spring Data

Spring Data is a collection of projects intended to make it easier to develop Spring-powered applications that use new data access technologies such as non-relational (NoSQL) databases. Based on a model of exposing Repository objects, Spring Data allows applications to access data in a simple and consistent way across many new platforms. Spring Batch 2.2.0.RELEASE provides ItemReader implementations for Neo4J and MongoDB as well as ItemWriter impelementaions for Neo4J, MongoDB and Gemfire. We also have created a RepositoryItemReader and RepositoryItemWriter. Each of these implementations wrap any custom implementation of PagingAndSortingRepository and CrudRepository respsectively.

Java Configuration

Joining most of the other major Spring projects, with Spring Batch 2.2.0.RELEASE, you will be able to configure your batch jobs via Java config. The @EnableBatchProcessing annotation provides access to not only builders that you can use to construct your batch jobs, but it adds the ability to autowire a number of useful objects (A JobRepository, JobLauncher, JobRegistry, PlatformTransactionManager) with no additional configuration required. Below is an example job configured via the new Java config.

@Configuration
 @EnableBatchProcessing
 @Import(DataSourceCnfiguration.class)
 public class AppConfig {

    @Autowired
    private JobBuilderFactory jobs;

    @Bean
    public Job job() {
        return jobs.get("myJob").start(step1()).next(step2()).build();
    }

    @Bean
    protected Step step1() {
       ...
    }

        @Bean
    protected Step step2() {
     ...
    }
 }

The above java config is equivelant to the below XML configuration.

<batch>
     <job-repository />
     <job id="myJob">
       <step id="step1" .../>
       <step id="step2" .../>
     </job>
     <beans:bean id="transactionManager" .../>
     <beans:bean id="jobLauncher" class="org.springframework.batch.core.launch.support.SimpleJobLauncher">
       <beans:property name="jobRepository" ref="jobRepository" />
     </beans:bean>
 </batch> 

Non-identifying Job Parameters

Running batch jobs that need the same parameters is a common use case. As of Spring Batch 2.2.0.RELEASE, Spring Batch now supports this use case by allowing jobs to accept non-identifying job parameters (parameters that do not contribute to the creation of a new JobInstance). This update did require both code changes as well as updates to the underlying database schema used by the Spring Batch job repository. Fortunately, we have provided a migration script to help with the transition. You can read the details about the migration script in the Getting Started Guide.

AMQP support

Utilizing the Spring AMQP project, Spring 2.2.0.RELEASE offers support for both reading and writing to AMQP endpoints.

##SQLFire support Previous versions of Spring Batch provided a number of options for what database to use within the job repository. With the release of Spring Batch 2.2.0.RELEASE, we add support for SQLFire as yet another option for you to store job repository data.

Dependency upgrade

As part of the ongoing work to keep the dependencies of Spring Batch up to date, we updated batch to support Spring 3.2.x (minimum level of support is now 3.1.2) as well as Hibernate 4 (within the Hibernate based ItemReaders and ItemWriters).

##Other updates and fixes Beyond all of the new features, we also address many bugs and provided numerous other improvements. The complete list of what has changed between Spring Batch 2.2.0.RELEASE and your current version of Spring Batch can be found here in the changelog.

Spring Batch Home | Source on GitHub | Reference Documentation

Get the Spring newsletter

Thank you for your interest. Someone will get back to you shortly.

Get ahead

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

Learn more

Get support

Tanzu 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