2 Replies Latest reply on Dec 9, 2014 8:08 AM by sandip.desale

    FSW - SwitchYard - Camel - File Processing

    sandip.desale

      I am working on a project where we need to parse a file of size > 2GB and load data into DB. I am planning to break file using camel splitter into 50 different files and then process each one using Apache Camel.

       

      My question is..

      While processing one of the file, camel route fails then how to stop camel route and audit this in DB with file name. It might happen that some of the records are processed and uploaded to DB and for a specific records it is failing. So how do we log this specific record in some other file for investigation purpose.

       

      Also while processing, due to network failure, DB operations are stopped. In this scenario file processing is incomplete. So how to handle incomplete file processing scenario using Swichyar Camel component as only remaining records should be processed again.

        • 1. Re: FSW - SwitchYard - Camel - File Processing
          kcbabo

          Camel puts the name of the received file in a message header ("CamelFileName"), so you could use that in combination with an error handler to record the details of the failure along with the original file name. 

           

          I'm not sure what you mean by "DB operations are stopped", but if you experience an issue with persisting data to a database as part of your route, you will get an exception and that exception can be used in combination with an error handler to compensate in any way you see fit.

          • 2. Re: FSW - SwitchYard - Camel - File Processing
            sandip.desale

            Thanks Keith. I am able to resolve it using CameFileName header.