6 Replies Latest reply on Oct 11, 2010 10:52 PM by jessica leahy

    Poll a directory, validate & FTP out. Loop this process over 10 directories

    donald esb Newbie

      Hi, I am doing a test project using servicemix 4 to Poll a directory, validate the files inside, get the correct file & FTP out to the destination.


      I need to loop this process over 10 directories. More directories will be added in future.


      The FTP destination for the file in each directory is different.


      The directory structure is like this example:

      dave\     contain dave.001 and dave.002 dave.003

      john\     contain john.001 and john.002 john.003

      kate\     contain kate.001 and kate.002 kate.003


      The plan here is roughly as follow:

      1.) Poll a directory

      a. the directory name e.g. c:
      dave\ is in a xml file where user can easily edit or add new.


      b. validate to only get a file with extension 002 e.g. dave.002


      c. FTP file to destination where the destination is also in the xml file e.g. dave's ip address


      d. if FTP failed, send email warning to me.



      2.) Poll the next directory whereby the directory name e.g. C:
      john\ is retrieved in the same xml file and repeat step a, b, c & d


      3.) Conitune to poll & FTP file in all 10 directories that are found in the xml files.


      4.) If user add new directory & ip entry into xml, servicemix will be able to poll the newly added directory.




      Is the above project feasible in servicemix 4?

      How should I approach, design and create the project?


      I have tried file poller and sender and found it difficult to loop through the 10 directories indicated in a xml file.


      Another issue is that I am using windows platform for development but my servicemix is inside linux OS. What are the pitfalls to look out for?