You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: spring-boot-project/spring-boot-docs/src/docs/asciidoc/howto/batch.adoc
+5-4Lines changed: 5 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -11,23 +11,24 @@ By default, batch applications require a `DataSource` to store job details.
11
11
Spring Batch expects a single `DataSource` by default.
12
12
To have it use a `DataSource` other than the application’s main `DataSource`, declare a `DataSource` bean, annotating its `@Bean` method with `@BatchDataSource`.
13
13
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.
16
17
17
18
For more info about Spring Batch, see the {spring-batch}[Spring Batch project page].
18
19
19
20
20
21
21
22
[[howto.batch.running-jobs-on-startup]]
22
23
=== 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.
24
25
25
26
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).
26
27
If multiple `Job` beans are found, the job that should be executed must be specified using configprop:spring.batch.job.name[].
27
28
28
29
To disable running a `Job` found in the application content, set the configprop:spring.batch.job.enabled[] to `false.`
29
30
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.
0 commit comments