Hi

Disconnect=true is to only re-use the old connection on the next poll.

If you only want to poll the file one time, then you need to stop the
route afterwards.
You can use the API from CamelContext to stop a route.

Also Camel in Action chapter 13 which explains and shows you how to do this.


On Sat, Oct 9, 2010 at 11:33 PM, tonyhe <[email protected]> wrote:
>
> Hi,
> I wanted to use Camel-FTP (v2.4) to download a file to a directory.
>
> Here I set up my routes:
>
> from("ftp://www.ibiblio.org/pub/mirrors/apache/camel/apache-camel/2.4.0/?filter=#camelFileFilter&disconnect=true";)
>    .to("file:target/messages/others");
>
>
> My camelFileFilter class
> public class CamelFileFilter implements GenericFileFilter
> {
>        final static Logger logger =
> Logger.getLogger(CamelFileFilter.class);
>
>    public boolean accept(GenericFile file)
>    {
>    logger.debug("fileName=" + file.getFileName());
>        return file.getFileName().equals("apache-camel-2.4.0.zip.asc");
>    }
> }
>
> I want this route to stop immediately when the "apache-camel-2.4.0.zip.asc"
> file has been downloaded. But it seems after Camel-FTP successfully
> downloads my file, it is ignoring my "disconnect=true" property and just
> keeps
> displaying:
> FtpConsumer                    INFO  Connected and logged in to:
> ftp://[email protected]:21
> FtpConsumer                    INFO  Connected and logged in to:
> ftp://[email protected]:21
> and never terminate the program.
>
> Has anyone else encountered this problem?
> --
> View this message in context: 
> http://camel.465427.n5.nabble.com/disconnect-true-is-not-working-for-Camel-FTP-file-download-tp3206046p3206046.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>



-- 
Claus Ibsen
Apache Camel Committer

Author of Camel in Action: http://www.manning.com/ibsen/
Open Source Integration: http://fusesource.com
Blog: http://davsclaus.blogspot.com/
Twitter: http://twitter.com/davsclaus

Reply via email to