camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From David Capwell <dcapw...@gmail.com>
Subject unable to control ftp delay
Date Thu, 28 Jun 2012 00:15:36 GMT
I am trying to use sftp (camel 2.9.2) and notice that every download is
spread out to one every 10 seconds (files are around 10kb).  Based off the
examples in http://camel.apache.org/ftp2.html it looks like there are delay
options (they are not listened under options, but used in example) but when
I use them nothing changes.  How can I have the client pull files faster?

Another question, if I am trying to write the ftp files locally, is there
any way to avoid the file download if the local file is around?
 I append fileExist=Ignore in the to() but it seems that the files still
get written again.

Here is the route I am using:

public void ftpToLocal() throws Exception {
    runRoutes(new RouteBuilder() {
      @Override
      public void configure() throws Exception {
        Registry registry = getContext().getRegistry();
        String user = (String) registry.lookup("ftpUser");
        String pass = (String) registry.lookup("ftpPass");

        // we use a delay of 60 minutes (eg. once pr. hour we poll the FTP
server
//        long delay = 60 * 60 * 1000L;
//        long delay = TimeUnit.SECONDS.toMillis(1);
        long delay = 200;

        from("sftp://"+user+"@example.com/path/to/dir?password=" + pass +
"&binary=true&delay="+delay+"&consumer.delay=" + delay)
            .to("file://data/ftp?fileExist=Ignore");
      }
    });
  }


Thanks for your time reading this email.

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message