About

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.

1. General information

1.1. Artifact

<dependencies>
    <dependency>
        <groupId>com.foreach.across.modules</groupId>
        <artifactId>spring-batch-module</artifactId>
        <version>1.0.0.RELEASE</version>
    </dependency>
</dependencies>

1.2. Module dependencies

SpringBatchModule does not have any dependencies on other modules.

1.3. Module settings

Property Type Description Default

springBatch.taskExecutor

org.springframework.core.task.TaskExecutor

The custom task executor to use for batch jobs.

null

2. What’s new in this version?

1.0.0.RELEASE

Initial public release available on Maven central.

3. 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.

4. 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.

5. 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.