0

I use spring boot and spring batch

public ItemWriter<T> writerOne(){
    ItemWriter<T> writer = new ItemWriter<T>();
    //your logic here
    return writer;
}

public ItemWriter<T> writerTwo(){
    ItemWriter<T> writer = new ItemWriter<T>();
    //your logic here
    return writer;
}

public CompositeItemWriter<T> compositeItemWriter(){
    CompositeItemWriter writer = new CompositeItemWriter();
    writer.setDelegates(Arrays.asList(writerOne(),writerTwo()));
    return writer;
}

I read a cvs file, do a process and after need to call two writer... Depending a field value, writerTwo must be called.

Is there any way to get this goal?

robert trudel
  • 5,283
  • 17
  • 72
  • 124

0 Answers0