Usecase:
I have a list of objects holding customer information. I have to make an API call using the customerId from the individual objects in the list.
Approch: Spring Batch Tasklet Implementation
Approch: Spring Batch Tasklet Implementation
Note: List is already available before the job starts.
One Tasklet is defined that takes in the customer ID and makes the call.
I have created a ListPartioner that is diving the list into partitions but I am stuck at - How to pass this data sequentially to the tasklet ?
From the comments
The below allows to pass partitioned data with chunk size to the step of Reader, Writer and Processor. How can I achieve this with a tasklet ?
@Bean(name="asyncStep")
protected Step asyncStep(JobRepository jobRepository, PlatformTransactionManager transactionManager) throws Exception { return new StepBuilder("myjob", jobRepository).
<EmployeeDTO,EmployeeDTO>chunk(2,transactionManager)
.reader(itemReader(null))
.processor(asyncItemProcessor())
.writer(asyncItemWriter())
.build();