Results 1 to 3 of 3

Thread: writing multiple messages to a file file:outbound-channel-adapter

Hybrid View

  1. #1
    Join Date
    Jan 2010
    Posts
    124

    Question writing multiple messages to a file file:outbound-channel-adapter

    I am planning to write failed messages to a file.
    However, the file:outbound-channel-adapter implementation saves each messages to a new file. Instead, i would like to have multiple messages per file.
    I would also like to read a file with several messages and then process it as it is my next logical step.

    I see that Spring integration doesn't provide a hook for a custom implementation here for end user.
    Today, i am able to use file name generator and apply a simple logic to create new files for every 'xxx' messages, but i couldn't find a way to append new messages to the same file.
    I looked at the code in FileWritingMessageHandler.handleStringMessage
    and thought its a simple fix to add this feature.

    I would appreciate your thoughts on this.

    --sri

  2. #2
    Join Date
    Jan 2008
    Location
    Mohnton, PA USA (that's near Philadelphia)
    Posts
    2,148

    Default

    Have you looked at Spring Batch? It has a lot of features with regard to complex file processing and is very often used and demonstrated with Spring Integration.
    Remember, Spring Integration is a light-weight messaging framework which provides adapters to transport a single message to a remote system and back (in your case message = file). It itself does not provide an API hooks to address more complex scenarios such as the one you describe, however Spring Batch does and in fact was designed around such requirements.

  3. #3
    Join Date
    Jan 2010
    Posts
    124

    Default

    Thanks for the pointer. I have never looked at Spring batch before, but always wanted to at some point. Now is the time, i guess.
    --sri
    [
    QUOTE=oleg.zhurakousky;331695]Have you looked at Spring Batch? It has a lot of features with regard to complex file processing and is very often used and demonstrated with Spring Integration.
    Remember, Spring Integration is a light-weight messaging framework which provides adapters to transport a single message to a remote system and back (in your case message = file). It itself does not provide an API hooks to address more complex scenarios such as the one you describe, however Spring Batch does and in fact was designed around such requirements.[/QUOTE]

Posting Permissions

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