Incorrect step configuration when setting the taskExecutor before faultTolerant() #4438
Labels
for: backport-to-5.0.x
Issues that will be back-ported to the 5.0.x line
for: backport-to-5.1.x
Issues that will be back-ported to the 5.1.x line
has: minimal-example
Bug reports that provide a minimal complete reproducible example
in: core
type: bug
Milestone
Hello,
I think I spotted an issue related to the StepBuilder. Depending on the order a developer build its step, the
taskExecutor
field will have different values.Here is a minimal example to reproduce the issue:
step1
andstep2
are exactly the same, except in one thing.In this example,
step2
will use the default task executor instead of the provided one.Looking at the code, the
taskExecutor
value is lost after settingfaultTolerant()
.I did not go too deep into the solution, but I think the issue comes from this constructor (see link). The
taskExecutor
value could be kept from there.spring-batch/spring-batch-core/src/main/java/org/springframework/batch/core/step/builder/AbstractTaskletStepBuilder.java
Line 73 in 75025a2
The text was updated successfully, but these errors were encountered: