Hello, a simple solution may be to use the .session file as a trigger for your routes. The ftp component waits for the .process and then launches your route with a custom processor on the files. Depending on your needs you may treat the files as one unit inside different processors or split them line by line to handle each one individually. If you are going to reuse this behaviour many times may be it is worth to create your own component. Regards. javier arias.
2011/5/25 Maurizio Branca <[email protected]> > Hi, > > I am dealing with an bi-directional integration with and external > using a FTP server. > > Our customer already have in place some non-trivial rules for what > usually is handled with a 'done file' in Camel. > > > A plain simple 20110001_DATAFILE (2MB CSV file) when published on the > FTP server becomes: > > 1. 20110001_DATAFILE_001 is written (1MB) > > 2. 20110001_DATAFILE_001.send is written (CSV metadata with > statistics on the file 20110001_DATAFILE_001 contents) > > 3. 20110001_DATAFILE_002 is written (1MB) > > 4. 20110001_DATAFILE_002.send is written (CSV metadata with > statistics on the file 20110001_DATAFILE_002 contents) > > 5. 20110001_DATAFILE.session is written (a zero size 'done file') > > The original CSV file can be splitted when it is bigger than a given > threshold (1MB in this example). > > These file are ready to be consumed when the .session file has been > created. > > And these files have to be both consumed and produced using these rules. > :-| > > > The standard FTP component can handle the .session file using the > doneFileName but does not supports multiple data files. I'm planning > to create a custom extension of the FTP component but I'm not sure > that it is the best solution. > > Any suggestion or observation about this context is really, really... > really welcome! :) > > > Thanks, > Maurizio Branca >
