我有3个步骤的工作(类似步骤1):Spring批处理Java配置:跳过步骤,例外并转到下一步
@Autowired
private StepBuilderFactory stepBuilderFactory;
@Bean
public Step step1() {
return stepBuilderFactory
.get("step1")
.<String, String> chunk(1)
.reader(reader())
.processor(processor())
.writer(writer())
.build();
}
如何走,即使在第1步异常后,执行步骤2和3?我的意思是用Java配置。
可能是您想尝试'StepExecutionListener'。它的'afterStep'在步骤流程处理中很有用。 – Minh