e.g. i have 3 Steps in Job (similar to Step1):
@Autowired
private StepBuilderFactory stepBuilderFactory;
@Bean
public Step step1() {
return stepBuilderFactory
.get("step1")
.<String, String> chunk(1)
.reader(reader())
.processor(processor())
.writer(writer())
.build();
}
How go to Step 2 and 3 even after exception in Step 1? I mean configuration in Java.
You can use StepBuilder.faultTolerant method and configuring xml in this fashion.
This would help in your case.
Please look at this : http://docs.spring.io/spring-batch/trunk/apidocs/org/springframework/batch/core/step/builder/SimpleStepBuilder.html#faultTolerant--
Here is an example on how to configure it when creating a flow. That should be similar to configure it directly with the job builder:
You can use
Skip Listener
Then in your step
Some helpful links
http://docs.spring.io/spring-batch/apidocs/org/springframework/batch/core/SkipListener.html
http://docs.spring.io/spring-batch/reference/html/configureStep.html#configuringSkip