Reputation: 71
I'm new to spring batch. Can someone please let me know if there is anyway to set separate chunk sizes or ItemReader and ItemWriter ? If I do the below way, both read and write chunk size is set to 10.
@Bean
public Step sampleStep(PlatformTransactionManager transactionManager) {
return this.stepBuilderFactory.get("sampleStep")
.transactionManager(transactionManager)
.<String, String>chunk(10)
.reader(itemReader())
.writer(itemWriter())
.build();
}
Upvotes: 0
Views: 1506
Reputation: 31600
That is not possible by design. A chunk oriented step is configured with a single chunk size (commit-interval) which is the same for the entire step. More details about chunk processing in Spring Batch here: https://docs.spring.io/spring-batch/4.0.x/reference/html/step.html#chunkOrientedProcessing
Upvotes: 1