camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Claus Ibsen <>
Subject Re: unable to control ftp delay
Date Thu, 28 Jun 2012 07:47:54 GMT

As mentioned on the ftp2 page

See the file2 page for more options as the ftp component inherits these options

The delay and consumer.delay option is the same. delay is just
shorthand for consumer.delay.

And no you cannot avoid the download if you later want to upload it
someplace else, and the file exists.
The ftp consumer don't know about this.

A tricky improvement could be to add a new option to only download the
file on demand, but that is a bit tricky
as you would need a live connection and the ftp client to still be
around and connected.

What are you trying to do? To sync files between 2 ftp servers?

On Thu, Jun 28, 2012 at 2:15 AM, David Capwell <> wrote:
> 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 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+"" + pass +
> "&binary=true&delay="+delay+"&consumer.delay=" + delay)
>            .to("file://data/ftp?fileExist=Ignore");
>      }
>    });
>  }
> Thanks for your time reading this email.

Claus Ibsen
Twitter: davsclaus, fusenews
Author of Camel in Action:

View raw message