0

I have a spring batch application where I have Reader - Processor - Composite Writer

Now there is one usecase in our application where, I need to write an empty file when my reader returns null (i.e. when it reads empty file) else, my reader should invoke processor - writer flow.

Any help or suggestion how can I tackle this case in best possible way?

Akshada
  • 190
  • 3
  • 12
  • So, do you want to skip the processor when reader returns null? You can still go to the processor and not do anything, like conditional if(list is null) or else and do the same in writer. – Gayatri Aug 08 '19 at 19:06
  • My processor not getting involved when Reader returns null..how can I write contional flow in Spring Batch for Reader Processor Writer? – Akshada Aug 09 '19 at 03:31
  • ok. It is the way Spring batch works that if reader returns null, that means there are no more records to be processed. So, instead of null, see if there is a way to return a non null or empty list. – Gayatri Aug 09 '19 at 18:10
  • If non Null or empty is returned it goes in infinite loop of reading. so above solution won't work i guess. – Akshada Aug 13 '19 at 11:16

0 Answers0