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
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.
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:This is because
org.springframework.batch.core.step.builder.FaultTolerantStepBuilder#listener(java.lang.Object)
returnsSimpleStepBuilder
while it should returnFaultTolerantStepBuilder
. Note how all other methods that are related to listener registration in theFaultTolerantStepBuilder
class returnFaultTolerantStepBuilder
and notSimpleStepBuilder
.Reference: https://stackoverflow.com/questions/52167498
The text was updated successfully, but these errors were encountered: