Spring Batch 1.1 Release Notes

Notable new features:

  • Job-level execution context (shared among all steps)
  • MultiResourceItemReader for reading multi-file input
  • SystemCommandTasklet for executing system commands
  • FlatFileItemWriter and StaxEventItemWriter support headers
  • Maven archetype
  • Modifiable transaction attributes for ItemOrientedStep
  • StepExecutionSimpleCompletionPolicy for pulling commit interval from JobParameters
  • MapJobRepositoryFactoryBean for easy setup of in-memory repository
  • StepExecution has persistent rollbackCount, readSkipCount and writeSkipCount
  • All ItemReader implementations default to returning null in the initial call to read if no data is found to process. NoWorkFoundListener can be used to fail a step if no work was done. (e.g. input was empty)
  • LineTokenizer implementations now properly enforce formatting. For example, a fixed length line must match the maximum line length defined in the provided ranges.
  • FlatFileItemWriter must be opened before it can be written to. However, open can be called multiple times before closing.
  • All ItemReader and ItemWriter implementations now default to saving state. (i.e. saveState=true by default)

Other

  • StatefulRetryStepFactoryBean is deprecated - use SkipLimitStepFactoryBean instead

Upgrade instructions from 1.0.1 to 1.1

  • update the database schema using the update script (or create a fresh schema) - note that 1.0.x jobs won't work with 1.1 schema
  • use the updated simple-job-launcher-context.xml (or remove TX advice for repository - it is applied automatically, and remove beans 'jobRegistry' and 'jobRegistryBeanPostProcessor')
  • jobs should run without modification