Announcement Announcement Module
Collapse
No announcement yet.
CompositeItemWriter writing to multiple files Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • CompositeItemWriter writing to multiple files

    Hi,

    Is there a way to conditionally write records into different files based on their certain criteria?

    I have started testing with 2 types of records. I am running Multithreaded batch job.
    Problem is, files are not created as expected. Records are written irrespective of their types.
    I have coded Custom compositeItemWriter(implementing ItemWriter) writing to two flatfileitemwriters conditionally. Write method of composite writer takes List<Object>, I have to iterate this list to identify each element's record type and then invoke flatfileitemwriter which again takes List as parameter.

    I am confused because FlatFileItemWriter takes List as parameter but not object.
Working...
X