You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by Bratislav Stojanovic <br...@gmail.com> on 2013/09/24 18:48:38 UTC

Starting method when transfer completes

Hi all,

I'm fetching some data every 30 secs from my FTP server into my local
folder using
a simple rule and that works fine. I would like now to start a method from
one of my
classes when (and only if) transfer completes successfully.

What is the best way to achieve that? By using .process or? What happens if
transfer
fails after a couple of files (for instance internet drops down)?

Thank you.

-- 
Bratislav Stojanovic, M.Sc.

Re: Starting method when transfer completes

Posted by Claus Ibsen <cl...@gmail.com>.
You could also take a look at
http://camel.apache.org/oncompletion.html

On Tue, Sep 24, 2013 at 6:48 PM, Bratislav Stojanovic
<br...@gmail.com> wrote:
> Hi all,
>
> I'm fetching some data every 30 secs from my FTP server into my local
> folder using
> a simple rule and that works fine. I would like now to start a method from
> one of my
> classes when (and only if) transfer completes successfully.
>
> What is the best way to achieve that? By using .process or? What happens if
> transfer
> fails after a couple of files (for instance internet drops down)?
>
> Thank you.
>
> --
> Bratislav Stojanovic, M.Sc.



-- 
Claus Ibsen
-----------------
Red Hat, Inc.
Email: cibsen@redhat.com
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen

Re: Starting method when transfer completes

Posted by Christian Posta <ch...@gmail.com>.
The file component (ftp derives from it) keeps track of "batch size" and
"batch index"... that is.. the number of files it grabbed per poll...you
could use those numbers + and aggregator or resequencer or something to
determine whether you've processed all the files, then call to a bean:
component of processor();


On Tue, Sep 24, 2013 at 9:48 AM, Bratislav Stojanovic <
bratislav1983@gmail.com> wrote:

> Hi all,
>
> I'm fetching some data every 30 secs from my FTP server into my local
> folder using
> a simple rule and that works fine. I would like now to start a method from
> one of my
> classes when (and only if) transfer completes successfully.
>
> What is the best way to achieve that? By using .process or? What happens if
> transfer
> fails after a couple of files (for instance internet drops down)?
>
> Thank you.
>
> --
> Bratislav Stojanovic, M.Sc.
>



-- 
*Christian Posta*
http://www.christianposta.com/blog
twitter: @christianposta