File tree Expand file tree Collapse file tree 1 file changed +18
-1
lines changed
spring-batch-docs/asciidoc Expand file tree Collapse file tree 1 file changed +18
-1
lines changed Original file line number Diff line number Diff line change @@ -450,8 +450,25 @@ The `@EnableBatchProcessing` works similarly to the other
450
450
The core interface for this configuration is the `BatchConfigurer`.
451
451
The default implementation provides the beans mentioned above and requires a
452
452
`DataSource` as a bean within the context to be provided. This data
453
- source will be used by the JobRepository.
453
+ source will be used by the JobRepository. You can customize any of these beans
454
+ by creating a custom implementation of the `BatchConfigurer` interface.
455
+ Typically, extending the `DefaultBatchConfigurer` (which is provided if a
456
+ `BatchConfigurer` is not found) and overriding the required getter is sufficient.
457
+ However, implementing your own from scratch may be required. The following
458
+ example shows how to provide a custom transaction manager:
454
459
460
+ [source, java]
461
+ ----
462
+ @Bean
463
+ public BatchConfigurer batchConfigurer() {
464
+ return new DefaultBatchConfigurer() {
465
+ @Override
466
+ public PlatformTransactionManager getTransactionManager() {
467
+ return new MyTransactionManager();
468
+ }
469
+ };
470
+ }
471
+ ----
455
472
456
473
457
474
[NOTE]
You can’t perform that action at this time.
0 commit comments