Results 1 to 5 of 5

Thread: Aggregator to multiple file outputs

  1. #1
    Join Date
    Oct 2009
    Location
    Minneapolis, MN
    Posts
    137

    Default Aggregator to multiple file outputs

    Hi

    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?

    Thanks
    Srinivas

  2. #2
    Join Date
    Mar 2010
    Location
    Gtr Philadelphia, PA
    Posts
    2,017

    Default

    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.
    Gary P. Russell
    Spring Integration Team
    SpringSource, a division of VMware

  3. #3
    Join Date
    Oct 2009
    Location
    Minneapolis, MN
    Posts
    137

    Default

    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. #4
    Join Date
    Mar 2010
    Location
    Gtr Philadelphia, PA
    Posts
    2,017

    Default

    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)
    Gary P. Russell
    Spring Integration Team
    SpringSource, a division of VMware

  5. #5
    Join Date
    Oct 2009
    Location
    Minneapolis, MN
    Posts
    137

    Default

    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.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •