You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by ronP12 <po...@bah.com> on 2010/01/12 22:54:53 UTC

RuntimeCamelException during Sftp

Hello,
 I  have a SFTP route that takes a JMS message as input.  In the message,
there is a property that states where the local file is that needs to be
transferred.  I unmarshal the object and use the property (fileLocation) in
the exchange  In my code I do something like this:

File transferFile = new File(fileLocation); 
GenericFile gf = new GenericFile();
gf.setBody(IOConverter.toInputStream(transferFile));

exchange.getIn().setBody(gf);

This will sftp a few files, but, then starts throwing the exception stating
it cannot find a temp file with a name like
/tmp/camel-tmp-123456/cos000111222.  Why is it using this tmp file and how
do I get around this?

Thanks!
-- 
View this message in context: http://old.nabble.com/RuntimeCamelException-during-Sftp-tp27135447p27135447.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: RuntimeCamelException during Sftp

Posted by Claus Ibsen <cl...@gmail.com>.
On Tue, Jan 12, 2010 at 10:54 PM, ronP12 <po...@bah.com> wrote:
>
> Hello,
>  I  have a SFTP route that takes a JMS message as input.  In the message,
> there is a property that states where the local file is that needs to be
> transferred.  I unmarshal the object and use the property (fileLocation) in
> the exchange  In my code I do something like this:
>
> File transferFile = new File(fileLocation);
> GenericFile gf = new GenericFile();
> gf.setBody(IOConverter.toInputStream(transferFile));
>
> exchange.getIn().setBody(gf);
>
> This will sftp a few files, but, then starts throwing the exception stating
> it cannot find a temp file with a name like
> /tmp/camel-tmp-123456/cos000111222.  Why is it using this tmp file and how
> do I get around this?
>

See the section _Consuming a remote FTP server triggered by a route_
on this wiki page:
http://camel.apache.org/ftp.html
which is based on Camel 1.x but the example is nearly the same.

Basically you should set the filename you want to consume using the
fileName option on the FTP consumer
http://camel.apache.org/file2.html

Note: the FTP2 component shares the options that exists in the file2
component, and hence the fileName option.


> Thanks!
> --
> View this message in context: http://old.nabble.com/RuntimeCamelException-during-Sftp-tp27135447p27135447.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