-
-
Save mminella/3437f89aa6ca85c6f94bd7772ed498a2 to your computer and use it in GitHub Desktop.
Bean With Listener
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Bean | |
public Step step1() { | |
return this.stepBuilderFactory.get("step1") | |
.<Integer, Integer>chunk(10) | |
.reader(new ListItemReader<>(IntStream.rangeClosed(0, this.random.nextInt(10000)) | |
.boxed().collect(Collectors.toList()))) | |
.writer(list -> list.forEach(System.out::println)) | |
.listener(new StepExecutionListener() { | |
@Override | |
public void beforeStep(StepExecution stepExecution) { | |
} | |
@Override | |
public ExitStatus afterStep(StepExecution stepExecution) { | |
return null; | |
} | |
}).build(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment