You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by kalber <Ka...@swslt.com> on 2013/08/26 08:49:19 UTC

Stop polling, FTP Component

hi,

i'm using FTP component with noop option.

After downloaded all files the process stops but
the program is still running.

How can i exit from the pooling cycle ?





--
View this message in context: http://camel.465427.n5.nabble.com/Stop-polling-FTP-Component-tp5737925.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Stop polling, FTP Component

Posted by Claus Ibsen <cl...@gmail.com>.
Hi

Ah okay this is expected as the Camel route will keep polling for new
files. You can configure how often it should do that etc.

There is many ways stop Camel or routes. Check out the docs and search
this forum as its been discussed in the past.

And check the FAQ etc also.


On Tue, Aug 27, 2013 at 4:03 PM, kalber <Ka...@swslt.com> wrote:
> Hi,
>
> i brought my route configuration into the ftp example of camel
> (/apache-camel-2.11.1/examples/camel-example-ftp)
> and configured out the ftp.properties for testing :
>
> ftp.client=ftp://myserver.xx.com:21/?username=myusernamet&password=mypassword
> ftp.server={{ftp.client}}&noop=true&include=pneus_20130821.csv
> --------------------------------------
>
> Launching 'mvn compile exec:java -Pserver' after  download
> process is waiting. Manually with contrl-c i can stop process.
>
> How can i programmatically or by configuration stop process ( or better
> polling ) ?
>
>
>
>
>
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/Stop-polling-FTP-Component-tp5737925p5738058.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



-- 
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: Stop polling, FTP Component

Posted by kalber <Ka...@swslt.com>.
Hi,

i brought my route configuration into the ftp example of camel
(/apache-camel-2.11.1/examples/camel-example-ftp)
and configured out the ftp.properties for testing :

ftp.client=ftp://myserver.xx.com:21/?username=myusernamet&password=mypassword
ftp.server={{ftp.client}}&noop=true&include=pneus_20130821.csv
--------------------------------------

Launching 'mvn compile exec:java -Pserver' after  download
process is waiting. Manually with contrl-c i can stop process.

How can i programmatically or by configuration stop process ( or better
polling ) ?







--
View this message in context: http://camel.465427.n5.nabble.com/Stop-polling-FTP-Component-tp5737925p5738058.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Stop polling, FTP Component

Posted by Claus Ibsen <cl...@gmail.com>.
Can you post the code you use for polling?

On Mon, Aug 26, 2013 at 8:49 AM, kalber <Ka...@swslt.com> wrote:
> hi,
>
> i'm using FTP component with noop option.
>
> After downloaded all files the process stops but
> the program is still running.
>
> How can i exit from the pooling cycle ?
>
>
>
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/Stop-polling-FTP-Component-tp5737925.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



-- 
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: Stop polling, FTP Component

Posted by kalber <Ka...@swslt.com>.
adding disconnect=true FTPComponent is in the 'Connected and logged in to'
loop

INFO  [Camel (camel-1) thread #0 - ftp://service.sad.it:21/] route1:
Downloaded file pneus_20130820.csv complete.
INFO  [Camel (camel-1) thread #0 - ftp://service.sad.it:21/] route1:
Downloaded file pneus_20130821.csv complete.
INFO  [Camel (camel-1) thread #0 - ftp://service.sad.it:21/] route1:
Downloaded file pneus_20130822.csv complete.
INFO  [Camel (camel-1) thread #0 - ftp://service.sad.it:21/] route1:
Downloaded file pneus_20130823.csv complete.
INFO  [Camel (camel-1) thread #0 - ftp://service.sad.it:21/] FtpConsumer:
Connected and logged in to: ftp://pneusmarket@service.sad.it:21
26-08-2013 13:34:09 INFO  [Camel (camel-1) thread #0 -
ftp://service.sad.it:21/] FtpConsumer: Connected and logged in to:
ftp://pneusmarket@service.sad.it:21




--
View this message in context: http://camel.465427.n5.nabble.com/Stop-polling-FTP-Component-tp5737925p5737957.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Stop polling, FTP Component

Posted by Bharath <bh...@gmail.com>.
Hi Kalber,

    There is an option called *disconnect* in camel-ftp component

Please refer camel-ftp2 component

http://camel.apache.org/ftp2.html

If you have a consumer which you want to stop, then you need to stop the
consumer/route instead.

You can manually start or stop a route at any time in Java by invoking the
startRoute() and stopRoute() methods on the CamelContext instance. For
example, to start the route having the route ID, nonAuto, invoke the
startRoute() method on the CamelContext instance, context, as follows:

//to start the route
context.startRoute("nonAuto");

//to stop the route
context.stopRoute("nonAuto");

For more Details refer this link
http://fusesource.com/docs/router/2.4/eip/BasicPrinciples-StartupShutdown.html

Cheers!!!
Bharath



--
View this message in context: http://camel.465427.n5.nabble.com/Stop-polling-FTP-Component-tp5737925p5737926.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Stop polling, FTP Component

Posted by Bharath <bh...@gmail.com>.
Hi,

   Is it a stand alone camel application or you deployed in any
containers???
   If it is a stand alone camel application please share the code in which
you are trying to test


Cheers!!!
Bharath.R



--
View this message in context: http://camel.465427.n5.nabble.com/Stop-polling-FTP-Component-tp5737925p5737962.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Stop polling, FTP Component

Posted by kalber <Ka...@swslt.com>.
yes it's complete, but program is still running.

6-08-2013 13:34:06 INFO  [Camel (camel-1) thread #0 -
ftp://service.sad.it:21/] route1: Downloaded file pneus_20130820.csv
complete.
26-08-2013 13:34:06 INFO  [Camel (camel-1) thread #0 -
ftp://service.sad.it:21/] route1: Downloaded file pneus_20130821.csv
complete.
26-08-2013 13:34:07 INFO  [Camel (camel-1) thread #0 -
ftp://service.sad.it:21/] route1: Downloaded file pneus_20130822.csv
complete.
26-08-2013 13:34:07 INFO  [Camel (camel-1) thread #0 -
ftp://service.sad.it:21/] route1: Downloaded file pneus_20130823.csv
complete.




--
View this message in context: http://camel.465427.n5.nabble.com/Stop-polling-FTP-Component-tp5737925p5737958.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Stop polling, FTP Component

Posted by Jean-Baptiste Onofré <jb...@nanthrax.net>.
Hi,

is your exchange complete ?

Regards
JB

On 08/26/2013 08:49 AM, kalber wrote:
> hi,
>
> i'm using FTP component with noop option.
>
> After downloaded all files the process stops but
> the program is still running.
>
> How can i exit from the pooling cycle ?
>
>
>
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/Stop-polling-FTP-Component-tp5737925.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>

-- 
Jean-Baptiste Onofré
jbonofre@apache.org
http://blog.nanthrax.net
Talend - http://www.talend.com

Re: Stop polling, FTP Component

Posted by Christian Müller <ch...@gmail.com>.
You have to stop the route by your self.
You can use the FTP (file) option "sendEmptyMessageWhenIdle" to know when
all files are processed. Than use a content based router to route this
exchange differently and use a processor/bean to stop the route [1].

[1] http://camel.apache.org/how-can-i-stop-a-route-from-a-route.html

Best,
Christian
-----------------

Software Integration Specialist

Apache Camel committer: https://camel.apache.org/team
V.P. Apache Camel: https://www.apache.org/foundation/
Apache Member: https://www.apache.org/foundation/members.html

https://www.linkedin.com/pub/christian-mueller/11/551/642


On Mon, Aug 26, 2013 at 8:49 AM, kalber <Ka...@swslt.com> wrote:

> hi,
>
> i'm using FTP component with noop option.
>
> After downloaded all files the process stops but
> the program is still running.
>
> How can i exit from the pooling cycle ?
>
>
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/Stop-polling-FTP-Component-tp5737925.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>