Monday, March 15, 2010

Spring Batch

Batch applications are used to process high volume business critical transactional data.

Spring Batch is the first Java based framework catered for batch process .For more information refer to http://static.springsource.org/spring-batch/reference/html-single/index.html#springBatchBackground

Building a batch application using Spring Batch Framework is relatively simple. The operation to be accomplished as a Batch task should be defined as a Job Bean. A typical batch program comprises of 3 logical steps which

1. reads a large number of records from a database, file, or queue
2. processes the data in some fashion, and
3. then writes back data in a modified form

The Spring batch framework provides interfaces to read(ItemReader),process(ItemProcessor) and write(ItemWriter) to achieve the same.

It provides better performance by using a chunk-oriented approach. For each Job a commit size can be provided,the Job would read and process the data and the actual writing into Database or File system is done only when the commit size is reached.

The following is sample of a simple Job Config with one step.


No comments:

Post a Comment