Skip to content

Commit 835199c

Browse files
committed
Clarify effects of @EnableBatchProcessing
Closes gh-48264
1 parent 580ad48 commit 835199c

File tree

1 file changed

+6
-3
lines changed
  • spring-boot-project/spring-boot-docs/src/docs/antora/modules/how-to/pages

1 file changed

+6
-3
lines changed

spring-boot-project/spring-boot-docs/src/docs/antora/modules/how-to/pages/batch.adoc

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,12 @@ By default, batch applications require a javadoc:javax.sql.DataSource[] to store
1313
Spring Batch expects a single javadoc:javax.sql.DataSource[] by default.
1414
To have it use a javadoc:javax.sql.DataSource[] other than the application’s main javadoc:javax.sql.DataSource[], declare a javadoc:javax.sql.DataSource[] bean, annotating its javadoc:org.springframework.context.annotation.Bean[format=annotation] method with javadoc:org.springframework.boot.autoconfigure.batch.BatchDataSource[format=annotation].
1515
If you do so and want two data sources (for example by retaining the main auto-configured javadoc:javax.sql.DataSource[]), set the `defaultCandidate` attribute of the javadoc:org.springframework.context.annotation.Bean[format=annotation] annotation to `false`.
16-
To take greater control, add javadoc:org.springframework.batch.core.configuration.annotation.EnableBatchProcessing[format=annotation] to one of your javadoc:org.springframework.context.annotation.Configuration[format=annotation] classes or extend javadoc:org.springframework.batch.core.configuration.support.DefaultBatchConfiguration[].
17-
See the API documentation of javadoc:org.springframework.batch.core.configuration.annotation.EnableBatchProcessing[format=annotation]
18-
and javadoc:org.springframework.batch.core.configuration.support.DefaultBatchConfiguration[] for more details.
16+
17+
To disable Spring Boot's auto-configuration and take complete control of Spring Batch's configuration, add javadoc:org.springframework.batch.core.configuration.annotation.EnableBatchProcessing[format=annotation] to one of your javadoc:org.springframework.context.annotation.Configuration[format=annotation] classes or extend javadoc:org.springframework.batch.core.configuration.support.DefaultBatchConfiguration[].
18+
This will also disable Spring Boot's support for initializing the Spring Batch database schema.
19+
20+
To learn more about manually configuring Spring Batch, see the API documentation of javadoc:org.springframework.batch.core.configuration.annotation.EnableBatchProcessing[format=annotation]
21+
and javadoc:org.springframework.batch.core.configuration.support.DefaultBatchConfiguration[].
1922

2023
For more info about Spring Batch, see the {url-spring-batch-site}[Spring Batch project page].
2124

0 commit comments

Comments
 (0)