Is1.Is there any approach to enhance the performance for processing 17,000 records, which currently takes approximately 21 minutes?
- Is it possible to utilize the parallelStream method within a Spring Batch item writer?
import org.springframework.batch.item.ItemWriter; public class EmployeeItemWritter implements ItemWriter{
{
@Override
public void write(Chunk<? extends Employee> chunk) throws Exception {
long startTime = System.currentTimeMillis();
employeeList.parallelStream().forEach(employee -> {
Map<String, Object> resultMap =employeeService.getEmpDetails(employee.getEmpId(),employee.getEmpTxnId);
});
long endTime = System.currentTimeMillis();
System.out.println("Processing time in milleseconds "+(endTime-startTime));
}
}