Hi all,

I am playing around with ServiceMix because it sounds like a great fit
for my client.  The organization has a number of integration problems to
solve, and seems to be keen on the idea of an ESB.  We're already a Java
+ Spring shop for internal applications, and the idea of the JBI
standard sounds like a good concept to me.  Well done on all your work
so far.

I tried to get something running with the FTPPoller component, and I
think I have found a few issues with it.  (I checked out the latest
source from CVS today to check whether anything has changed in FTPPoller
from SM 1.0 -- seems not.)

  1) processFile() doesn't call done(exchange) after setting it up.  It
seems like this is a necessary step!  (It sure makes it work better for
me...)

  2) FTPPoller doesn't seem to have any handling for directories.  E.g.
my test FTP server (WarFTP for windows) returns "." and ".." from
listFiles(), and that seems to cause some trouble.  (FTPPoller tries to
download them.)

  3) The path property, as implemented, doesn't work for me.  The logic

            if (path != null) {
                files = ftp.listFiles(path);
            }
            else {
                files = ftp.listFiles();
            }

leaves the FTPClient in the top directory, and subsequently
client.retrieveFileStream(), which does not specify the path, doesn't
work.

I added:

  private String getWorkingPath() {
    return path == null ? "." : path;
  }

And made a couple other changes:

      // (in poll())
      FTPFile[] files = ftp.listFiles(getWorkingPath()); 


      // (in processFile())
      InputStream in = client.retrieveFileStream(getWorkingPath() +
name);

      // (in the other processFile())
      client.deleteFile(getWorkingPath() + file.getName());

This works for me.

  4) There seems to be some issue with whether FTPClient completes
commands synchronously.  I had to add 

    client.completePendingCommand();

after retrieveFileStream() to get it to work reliably.  Is this correct?
(I haven't used FTPClient before.)

  5) There is very little error checking generally.  For example, if it
fails to delete the file from the server after it is retrieved, there is
no error reported.  Should there be?

I am pretty keen to use ServiceMix (at least in a trial), and would be
willing to help at least with fixes for things like this that I'm using.
What should I do?  Send a new copy of FTPPoller.java to someone?  Or a
patch?  Use JIRA?

Sorry about the long note ...

John Hurst
Wellington, New Zealand


______________________________________________________________________
This email has been scanned by the MessageLabs Email Security System.
For more information please visit http://www.messagelabs.com/email 
______________________________________________________________________

Reply via email to