Monday, March 15, 2010
Step [null] has neither a element nor a 'ref' attribute referencing a Tasklet
Steps Execution in Spring Batch
When a job consists of multiple steps ,it may be necessary to pass information between the steps. Each Step has a StepExecutionContext but this exists only for the span of the step. To make the data available to future Steps, it will have to be passed to the Job ExecutionContext after the step has finished. Spring Batch provides the ExecutionContextPromotionListener for this purpose. The listener must be configured with the keys related to the data in the ExecutionContext that must be promoted and must be registered with the Step.
The sample of Job with multiple steps
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.