Announcement Announcement Module
No announcement yet.
writeFooter not called Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • writeFooter not called

    Hi guys,

    I have a CustomFlatFileItemWriter which extends FlatFileItemWriter and implements FlatFileFooterCallback.

    My file gets created and all the contents gets written, except for my footer.

    It seem to me as if my writeFooter method is not called at all.

    Am I missing something?

  • #2
    Did you remember to call setFooterCallback(this)?


    • #3
      I have now since changed my implementation according to the delegate patterns as set out in the docs.

      That is my CustomWriter now implements ItemWriter instead of extending FlatFileItemWriter.

      I now have my FlatFileItemWriter as a delegate.

      all is well execpt that I now get a writer must be open before it can be written to error.

      I have implemented ItemStream and overridden the open method, but how do I actually open my delegate flatFileItemWriter to avoid this error?


      • #4
        either have your composite writer's open() method call "", or configure the delegate itself to be a stream.


        • #5
          You should register the delegate as a stream. Any readers or writers directly wired into a step will be auto-detected, but the framework has no way of knowing what 'transitive dependencies' of readers and writers may be using that are also ItemStreams.


          • #6
            Thanks, did that and it worked like a charm