File tree 1 file changed +21
-0
lines changed
spring-batch-docs/src/main/asciidoc
1 file changed +21
-0
lines changed Original file line number Diff line number Diff line change @@ -438,6 +438,27 @@ created in addition to a number of beans made available to be autowired:
438
438
The core interface for this configuration is the `BatchConfigurer`. The default
439
439
implementation provides the beans mentioned above and requires a `DataSource` as a bean
440
440
within the context to be provided. This data source is used by the JobRepository.
441
+ You can customize any of these beans
442
+ by creating a custom implementation of the `BatchConfigurer` interface.
443
+ Typically, extending the `DefaultBatchConfigurer` (which is provided if a
444
+ `BatchConfigurer` is not found) and overriding the required getter is sufficient.
445
+ However, implementing your own from scratch may be required. The following
446
+ example shows how to provide a custom transaction manager:
447
+
448
+ ====
449
+ [source, java]
450
+ ----
451
+ @Bean
452
+ public BatchConfigurer batchConfigurer() {
453
+ return new DefaultBatchConfigurer() {
454
+ @Override
455
+ public PlatformTransactionManager getTransactionManager() {
456
+ return new MyTransactionManager();
457
+ }
458
+ };
459
+ }
460
+ ----
461
+ ====
441
462
442
463
[NOTE]
443
464
====
You can’t perform that action at this time.
0 commit comments