You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by Denis S <ds...@yahoo.com> on 2012/11/07 06:35:29 UTC

An issue with SFTP component

Hi,

I have the following Camel route:

<endpoint id="sftpImport"
uri="sftp://${import.user}@${import.host}:${import.port}/${import.path}?binary=true&amp;localWorkDirectory=../temp"/>

<route id="import">
    <from uri="quartz://ImportTimer?cron=0+0+15+?+*+MON-FRI"/>
    <pollEnrich ref="sftpImport" timeout="-1"/>
    <log message="SFTP processed. Body: ${body}" loggingLevel="INFO"/>
    <to uri="file://../import"/>
    <log message="Files transfered. Body: ${body}" loggingLevel="INFO"/>
</route>

So, the route takes a bunch of files from external FTP and put them in a
local folder. It uses localWorkDir to store files temporary. Files are huge
so it takes some time to transfer them. The issue I have: only the first
file placed to the /import folder properly. All other files left in /temp
directory. How can I solve this issue?

Thanks, Denis.



--
View this message in context: http://camel.465427.n5.nabble.com/An-issue-with-SFTP-component-tp5722274.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: An issue with SFTP component

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

PollEnrich is only for polling a *single* message. And therefore it
only downloads 1 file.

Instead of starting the route with a quartz endpoint, you should start from ftp.
And use a route policy to control when the route runs, and for that
there is a quartz route policy you can use
http://camel.apache.org/routepolicy

On Wed, Nov 7, 2012 at 6:35 AM, Denis S <ds...@yahoo.com> wrote:
> Hi,
>
> I have the following Camel route:
>
> <endpoint id="sftpImport"
> uri="sftp://${import.user}@${import.host}:${import.port}/${import.path}?binary=true&localWorkDirectory=../temp"/>
>
> <route id="import">
>     <from uri="quartz://ImportTimer?cron=0+0+15+?+*+MON-FRI"/>
>     <pollEnrich ref="sftpImport" timeout="-1"/>
>     <log message="SFTP processed. Body: ${body}" loggingLevel="INFO"/>
>     <to uri="file://../import"/>
>     <log message="Files transfered. Body: ${body}" loggingLevel="INFO"/>
> </route>
>
> So, the route takes a bunch of files from external FTP and put them in a
> local folder. It uses localWorkDir to store files temporary. Files are huge
> so it takes some time to transfer them. The issue I have: only the first
> file placed to the /import folder properly. All other files left in /temp
> directory. How can I solve this issue?
>
> Thanks, Denis.
>
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/An-issue-with-SFTP-component-tp5722274.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



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