Announcement Announcement Module
No announcement yet.
Aggregator to multiple file outputs Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • Aggregator to multiple file outputs


    I have a usecase where the result of Aggregation needs to be written to a single output file or multiple output files. This decision depends on the Threshold values of current file being written.
    Can this be achieved?


  • #2
    It's not entirely clear what you mean.

    In general, yes, you can route on some condition (e.g. aggregate size of the collection). On one path, split the payload and send the each message to a file adapter that appends to a single file. On the other path, split the payload and route to an adapter that creates a new file for each message.


    • #3
      Sorry for not being clear.
      If we have like 1000 items as a result of Aggregation, The file threshold says each file can allow 800 items, so i need 800 written to the first file and the remaining written to the second file. Hope this is clear.


      • #4
        Well, the question is what an "item" is. But, if it's as simple as that...

        All you need is a custom splitter that first splits the result of the aggregation into collections with <= 800 iterms; then another splitter to split those payloads, then a file outbound adapter that appends.

        ->splitInto800s->splitter->file-outbound-adapter(with append)


        • #5
          The "item" or the object i have in the aggregation has an attribute of something like record count, so i need to sum up these record count within that custom splitter seems like. Will analyze more, thanks for your input.