Skip to content

Commit 04bbbb4

Browse files
fmbenhassinemhalbritter
authored andcommitted
Update Batch documentation
This commit updates the documentation about how to configure Spring Batch v5 with Spring Boot v3. See gh-34437
1 parent 3ea99d0 commit 04bbbb4

File tree

1 file changed

+5
-4
lines changed
  • spring-boot-project/spring-boot-docs/src/docs/asciidoc/howto

1 file changed

+5
-4
lines changed

spring-boot-project/spring-boot-docs/src/docs/asciidoc/howto/batch.adoc

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,23 +11,24 @@ By default, batch applications require a `DataSource` to store job details.
1111
Spring Batch expects a single `DataSource` by default.
1212
To have it use a `DataSource` other than the application’s main `DataSource`, declare a `DataSource` bean, annotating its `@Bean` method with `@BatchDataSource`.
1313
If you do so and want two data sources, remember to mark the other one `@Primary`.
14-
To take greater control, implement `BatchConfigurer`.
15-
See {spring-batch-api}/core/configuration/annotation/EnableBatchProcessing.html[The Javadoc of `@EnableBatchProcessing`] for more details.
14+
To take greater control, add `@EnableBatchProcessing` to one of your `@Configuration` classes or extend `DefaultBatchConfiguration`.
15+
See the Javadoc of {spring-batch-api}/core/configuration/annotation/EnableBatchProcessing.html[`@EnableBatchProcessing`]
16+
and {spring-batch-api}/core/configuration/support/DefaultBatchConfiguration.html[`DefaultBatchConfiguration`] for more details.
1617

1718
For more info about Spring Batch, see the {spring-batch}[Spring Batch project page].
1819

1920

2021

2122
[[howto.batch.running-jobs-on-startup]]
2223
=== Running Spring Batch Jobs on Startup
23-
Spring Batch auto-configuration is enabled by adding `@EnableBatchProcessing` to one of your `@Configuration` classes.
24+
Spring Batch auto-configuration is enabled by adding `spring-boot-starter-batch` to your application's classpath.
2425

2526
If a single `Job` is found in the application context, it is executed on startup (see {spring-boot-autoconfigure-module-code}/batch/JobLauncherApplicationRunner.java[`JobLauncherApplicationRunner`] for details).
2627
If multiple `Job` beans are found, the job that should be executed must be specified using configprop:spring.batch.job.name[].
2728

2829
To disable running a `Job` found in the application content, set the configprop:spring.batch.job.enabled[] to `false.`
2930

30-
See {spring-boot-autoconfigure-module-code}/batch/BatchAutoConfiguration.java[BatchAutoConfiguration] and {spring-batch-api}/core/configuration/annotation/EnableBatchProcessing.html[@EnableBatchProcessing] for more details.
31+
See {spring-boot-autoconfigure-module-code}/batch/BatchAutoConfiguration.java[BatchAutoConfiguration] for more details.
3132

3233

3334

0 commit comments

Comments
 (0)