Announcement Announcement Module
Collapse
No announcement yet.
File Transformation Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • File Transformation

    I was wondering if anyone had any recommendations on the ways to integrate file transformations within Spring Integration. For example, in some integration products, it is fairly simple to convert delimited files to xml, xml to xml, etc by mapping fields through a designer GUI. The use case would be you have a data file in a certain format. This data file goes to X number of clients who all have a different required data format. I realize I can do this via marshalling to objects and then un-marshalling to xml, or whatever formats. I am looking for something though that can handle various file formats and mapping them without having to build a bunch of java classes as temporary data holders. Thanks.

  • #2
    use smooks and spring integration together

    Use spring integration to adapt the files to Strings in your Java code and then use the smooks library to transform the strings to Java, XML etc. You can use Freemarker templates to format the output from the Java objects and then again use Spring integration file adapters to write out the files. This also gives you an opportunity to enrich the incoming data when it is in POJO form.

    Comment


    • #3
      You also might want to consider Spring Batch. That would especially be a good idea if you are dealing with large files and want to process rows in, well... batches, but even if you just want to "borrow" some of its functionality for reading and tokenizing lines from a file, the underlying support classes can easily be used from within a Spring Integration application. See this for more detail: http://static.springsource.org/sprin...html#flatFiles

      Smooks also seems like a great idea. If anyone wants to contribute Smooks support, let me know!

      Thanks,
      Mark

      Comment


      • #4
        Thanks for your responses. I will definitely take a look at Smooks. My team is also starting to look at Spring Batch more and I have actually used the FlatFileItemReader in the past. Looks like if you could combine Spring Batch, Spring Integration, and Smooks, that could be a powerful combination.

        Comment

        Working...
        X