Spring Batch - Reference Documentation

Authors

Lucas Ward, Dave Syer, Thomas Risberg, Robert Kasanicky, Dan Garrette, Wayne Lund, Michael Minella, Chris Schaefer

Spring Batch 2.2.7.RELEASE

Copies of this document may be made for your own use and for distribution to others, provided that you do not charge any fee for such copies and further provided that each copy contains this Copyright Notice, whether distributed in print or electronically.


1. Spring Batch Introduction
1.1. Background
1.2. Usage Scenarios
1.3. Spring Batch Architecture
2. What's New in Spring Batch 2.2
2.1. Spring Data Integration
2.2. Java Configuration
2.3. Spring Retry
2.4. Job Parameters
3. The Domain Language of Batch
3.1. Job
3.1.1. JobInstance
3.1.2. JobParameters
3.1.3. JobExecution
3.2. Step
3.2.1. StepExecution
3.3. ExecutionContext
3.4. JobRepository
3.5. JobLauncher
3.6. Item Reader
3.7. Item Writer
3.8. Item Processor
3.9. Batch Namespace
4. Configuring and Running a Job
4.1. Configuring a Job
4.1.1. Restartability
4.1.2. Intercepting Job Execution
4.1.3. Inheriting from a Parent Job
4.1.4. JobParametersValidator
4.2. Java Config
4.3. Configuring a JobRepository
4.3.1. Transaction Configuration for the JobRepository
4.3.2. Changing the Table Prefix
4.3.3. In-Memory Repository
4.3.4. Non-standard Database Types in a Repository
4.4. Configuring a JobLauncher
4.5. Running a Job
4.5.1. Running Jobs from the Command Line
4.5.1.1. The CommandLineJobRunner
4.5.1.2. ExitCodes
4.5.2. Running Jobs from within a Web Container
4.6. Advanced Meta-Data Usage
4.6.1. Querying the Repository
4.6.2. JobRegistry
4.6.2.1. JobRegistryBeanPostProcessor
4.6.2.2. AutomaticJobRegistrar
4.6.3. JobOperator
4.6.4. JobParametersIncrementer
4.6.5. Stopping a Job
4.6.6. Aborting a Job
5. Configuring a Step
5.1. Chunk-Oriented Processing
5.1.1. Configuring a Step
5.1.2. Inheriting from a Parent Step
5.1.2.1. Abstract Step
5.1.2.2. Merging Lists
5.1.3. The Commit Interval
5.1.4. Configuring a Step for Restart
5.1.4.1. Setting a StartLimit
5.1.4.2. Restarting a completed step
5.1.4.3. Step Restart Configuration Example
5.1.5. Configuring Skip Logic
5.1.6. Configuring Retry Logic
5.1.7. Controlling Rollback
5.1.7.1. Transactional Readers
5.1.8. Transaction Attributes
5.1.9. Registering ItemStreams with the Step
5.1.10. Intercepting Step Execution
5.1.10.1. StepExecutionListener
5.1.10.2. ChunkListener
5.1.10.3. ItemReadListener
5.1.10.4. ItemProcessListener
5.1.10.5. ItemWriteListener
5.1.10.6. SkipListener
5.2. TaskletStep
5.2.1. TaskletAdapter
5.2.2. Example Tasklet Implementation
5.3. Controlling Step Flow
5.3.1. Sequential Flow
5.3.2. Conditional Flow
5.3.2.1. Batch Status vs. Exit Status
5.3.3. Configuring for Stop
5.3.3.1. The 'End' Element
5.3.3.2. The 'Fail' Element
5.3.3.3. The 'Stop' Element
5.3.4. Programmatic Flow Decisions
5.3.5. Split Flows
5.3.6. Externalizing Flow Definitions and Dependencies Between Jobs
5.4. Late Binding of Job and Step Attributes
5.4.1. Step Scope
6. ItemReaders and ItemWriters
6.1. ItemReader
6.2. ItemWriter
6.3. ItemProcessor
6.3.1. Chaining ItemProcessors
6.3.2. Filtering Records
6.3.3. Fault Tolerance
6.4. ItemStream
6.5. The Delegate Pattern and Registering with the Step
6.6. Flat Files
6.6.1. The FieldSet
6.6.2. FlatFileItemReader
6.6.2.1. LineMapper
6.6.2.2. LineTokenizer
6.6.2.3. FieldSetMapper
6.6.2.4. DefaultLineMapper
6.6.2.5. Simple Delimited File Reading Example
6.6.2.6. Mapping Fields by Name
6.6.2.7. Automapping FieldSets to Domain Objects
6.6.2.8. Fixed Length File Formats
6.6.2.9. Multiple Record Types within a Single File
6.6.2.10. Exception Handling in Flat Files
6.6.3. FlatFileItemWriter
6.6.3.1. LineAggregator
6.6.3.2. Simplified File Writing Example
6.6.3.3. FieldExtractor
6.6.3.4. Delimited File Writing Example
6.6.3.5. Fixed Width File Writing Example
6.6.3.6. Handling File Creation
6.7. XML Item Readers and Writers
6.7.1. StaxEventItemReader
6.7.2. StaxEventItemWriter
6.8. Multi-File Input
6.9. Database
6.9.1. Cursor Based ItemReaders
6.9.1.1. JdbcCursorItemReader
6.9.1.2. HibernateCursorItemReader
6.9.1.3. StoredProcedureItemReader
6.9.2. Paging ItemReaders
6.9.2.1. JdbcPagingItemReader
6.9.2.2. JpaPagingItemReader
6.9.2.3. IbatisPagingItemReader
6.9.3. Database ItemWriters
6.10. Reusing Existing Services
6.11. Validating Input
6.12. Preventing State Persistence
6.13. Creating Custom ItemReaders and ItemWriters
6.13.1. Custom ItemReader Example
6.13.1.1. Making the ItemReader Restartable
6.13.2. Custom ItemWriter Example
6.13.2.1. Making the ItemWriter Restartable
7. Scaling and Parallel Processing
7.1. Multi-threaded Step
7.2. Parallel Steps
7.3. Remote Chunking
7.4. Partitioning
7.4.1. PartitionHandler
7.4.2. Partitioner
7.4.3. Binding Input Data to Steps
8. Repeat
8.1. RepeatTemplate
8.1.1. RepeatContext
8.1.2. RepeatStatus
8.2. Completion Policies
8.3. Exception Handling
8.4. Listeners
8.5. Parallel Processing
8.6. Declarative Iteration
9. Retry
9.1. RetryTemplate
9.1.1. RetryContext
9.1.2. RecoveryCallback
9.1.3. Stateless Retry
9.1.4. Stateful Retry
9.2. Retry Policies
9.3. Backoff Policies
9.4. Listeners
9.5. Declarative Retry
10. Unit Testing
10.1. Creating a Unit Test Class
10.2. End-To-End Testing of Batch Jobs
10.3. Testing Individual Steps
10.4. Testing Step-Scoped Components
10.5. Validating Output Files
10.6. Mocking Domain Objects
11. Common Batch Patterns
11.1. Logging Item Processing and Failures
11.2. Stopping a Job Manually for Business Reasons
11.3. Adding a Footer Record
11.3.1. Writing a Summary Footer
11.4. Driving Query Based ItemReaders
11.5. Multi-Line Records
11.6. Executing System Commands
11.7. Handling Step Completion When No Input is Found
11.8. Passing Data to Future Steps
A. List of ItemReaders and ItemWriters
A.1. Item Readers
A.2. Item Writers
B. Meta-Data Schema
B.1. Overview
B.1.1. Example DDL Scripts
B.1.2. Version
B.1.3. Identity
B.2. BATCH_JOB_INSTANCE
B.3. BATCH_JOB_EXECUTION_PARAMS
B.4. BATCH_JOB_EXECUTION
B.5. BATCH_STEP_EXECUTION
B.6. BATCH_JOB_EXECUTION_CONTEXT
B.7. BATCH_STEP_EXECUTION_CONTEXT
B.8. Archiving
B.9. International and Multi-byte Characters
B.10. Recommendations for Indexing Meta Data Tables
Glossary