-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Closed
Labels
for: backport-to-4.3.xIssues that will be back-ported to the 4.3.x lineIssues that will be back-ported to the 4.3.x linein: coretype: bug
Milestone
Description
As of v4.3.6, it is not possible to register an annotation-based StepExecutionListener
in a fault-tolerant step. The following snippet does not compile:
FaultTolerantStepBuilder builder = new StepBuilder("step")
.repository(jobRepository)
.transactionManager(transactionManager)
.chunk(5)
.reader(new DummyItemReader())
.writer(new DummyItemWriter())
.faultTolerant()
.listener(new AnnotationBasedStepExecutionListener()); // compilation error here
This is because org.springframework.batch.core.step.builder.FaultTolerantStepBuilder#listener(java.lang.Object)
returns SimpleStepBuilder
while it should return FaultTolerantStepBuilder
. Note how all other methods that are related to listener registration in the FaultTolerantStepBuilder
class return FaultTolerantStepBuilder
and not SimpleStepBuilder
.
Reference: https://stackoverflow.com/questions/52167498
Metadata
Metadata
Assignees
Labels
for: backport-to-4.3.xIssues that will be back-ported to the 4.3.x lineIssues that will be back-ported to the 4.3.x linein: coretype: bug