-
1. Re: Poll a directory, validate & FTP out. Loop this process over 10 directories
davsclaus Sep 20, 2010 1:28 AM (in response to donaldesb)Hi
I think Camel may be a good way to try to implement this.
For example you can implement a custom filter as a org.apache.camel.component.file.GenericFileFilter implementation, which reads that master XML file that contains the list of directories to use. Then you assign that filter to the ftp endpoint.
Then you know in the filter to return either true of false if the given file is within that master XML list of valid directories.
Then you can use recipient list EIP pattern to send the message to the FTP endpoint based on the IP address from the master XML list. You can use Java code to load the masterXML file and based on the file name from the message you can map it to the IP address.
And you can use error handling in Camel to catch exception and detour routing and send an email with some custom error message indicating the error.
http://camel.apache.org/enterprise-integration-patterns.html
http://camel.apache.org/error-handling-in-camel.html
Edited by: davsclaus on Sep 20, 2010 5:27 AM
-
2. Re: Poll a directory, validate & FTP out. Loop this process over 10 directories
donaldesb Sep 21, 2010 11:42 AM (in response to davsclaus)Hi davsclaus,
Thanks for your guidance. I study & modify the hillert's example mentioned in camel webminar. I am left with exception handling and logging part.
Thanks a lot!
-
3. Re: Poll a directory, validate & FTP out. Loop this process over 10 directories
jessicaleahy Sep 22, 2010 11:51 PM (in response to davsclaus)hi, I tried this one as well. I had a hard time with logging but I resolved it.
-
4. Re: Poll a directory, validate & FTP out. Loop this process over 10 directories
donaldesb Oct 8, 2010 9:41 AM (in response to jessicaleahy)Hi jessica, i tried another approach for logging. i moved the camel project into servicemix. Took me some time to make the ftp and osgi deployment to work. Then i try splitting the existing servicemix log into various level. Finally creating the individual log file for each of the customers.
-
5. Re: Poll a directory, validate & FTP out. Loop this process over 10 directories
jessicaleahy Oct 11, 2010 10:48 PM (in response to donaldesb)Hi donald,thank you for the information. When I run to this problem, which is I hope not to, I'll give your approach a try.
-
6. Re: Poll a directory, validate & FTP out. Loop this process over 10 directories
jessicaleahy Oct 11, 2010 10:52 PM (in response to donaldesb)Do you have a code that you can recommend that i use?:)
Edited by: jessicaleahy on Oct 12, 2010 2:52 AM