SpringBatchModule

The SpringBatchModule activates support for Spring Batch jobs. It takes care of creating the necessary Spring Batch related infrastructure for a database backed job store. Modules depending on the SpringBatchModule can simply use the infrastructure beans and define or execute jobs.

Default configuration

The SpringBatchModule will setup database backed Spring Batch support and will install the required schema when bootstrapping.

Batch related infrastructure will be created and the following beans exposed:

  • JobRegistry

  • JobRepository

  • JobLauncher

  • JobExplorer

  • JobBuilderFactory

  • StepBuilderFactory

Support for @JobScope and @StepScope annotations in other modules will also be enabled. Beans of type Job created in other modules will automatically be added to the JobRegistry in a group with the same name as the module that defined the job.

TaskExecutor

By default the SpringBatchModule will use a SimpleJobLauncher with an SimpleAsyncTaskExecutor that handles up to 5 jobs concurrently. If you want to change the TaskExecutor being used, you can do so through the springBatch.taskExecutor property.

Transaction manager

By default the SpringBatchModule will scan the ApplicationContext in order to find an appropriate PlatformTransactionManager bean. You can force a PlatformTransactionManager bean to be used by naming it springBatchTransactionManager and ensuring the SpringBatchModule context can find it.