You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by igor <ag...@mail.ru> on 2015/12/15 13:07:49 UTC

How to dynamycally load file from ftp during route processing?

I have a queue that accepts messages with file names, files are stored on
ftp.
The question is how to load the file during message processing?

E.g. I have route like this:

 from(getProcessorQueueName())
                .setProperty(FILE_NAME,body())
                // what should I call here so camel goes to ftp and
downloads specific file for me?
                .process(parseFileNameProcessor)
                .process(storeFileProcessor)

I tried recipientList call with ftp expression (e.g.
ftp://user@host?password=pass&fileName=file.txt&move=done&moveFailed=error),
but it looks like this is trying to store file instead of download it.

Thanks in advance, Igor.



--
View this message in context: http://camel.465427.n5.nabble.com/How-to-dynamycally-load-file-from-ftp-during-route-processing-tp5775082.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: How to dynamycally load file from ftp during route processing?

Posted by Claus Ibsen <cl...@gmail.com>.
No unless you write some java code and use a consumer template etc to
build the uri to use.

On Tue, Dec 15, 2015 at 3:37 PM, igor <ag...@mail.ru> wrote:
> I just tried the pollEnrich method, and it works, but my problem is that it
> does not access any data from the current exchange till version 2.16.
>
> is there a way to achieve the same in 2.15.2?
>
> from("queue")
>                 .setProperty(FILE_NAME,body())
>                 .pollEnrich("ftp:login@host?password&fileName=${body}")
>
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/How-to-dynamycally-load-file-from-ftp-during-route-processing-tp5775082p5775098.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



-- 
Claus Ibsen
-----------------
http://davsclaus.com @davsclaus
Camel in Action 2: https://www.manning.com/ibsen2

Re: How to dynamycally load file from ftp during route processing?

Posted by igor <ag...@mail.ru>.
I just tried the pollEnrich method, and it works, but my problem is that it
does not access any data from the current exchange till version 2.16.

is there a way to achieve the same in 2.15.2?

from("queue")
                .setProperty(FILE_NAME,body())
                .pollEnrich("ftp:login@host?password&fileName=${body}")



--
View this message in context: http://camel.465427.n5.nabble.com/How-to-dynamycally-load-file-from-ftp-during-route-processing-tp5775082p5775098.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: How to dynamycally load file from ftp during route processing?

Posted by Claus Ibsen <cl...@gmail.com>.
See the content enricher eip, and the pollEnrich

On Tue, Dec 15, 2015 at 1:07 PM, igor <ag...@mail.ru> wrote:
> I have a queue that accepts messages with file names, files are stored on
> ftp.
> The question is how to load the file during message processing?
>
> E.g. I have route like this:
>
>  from(getProcessorQueueName())
>                 .setProperty(FILE_NAME,body())
>                 // what should I call here so camel goes to ftp and
> downloads specific file for me?
>                 .process(parseFileNameProcessor)
>                 .process(storeFileProcessor)
>
> I tried recipientList call with ftp expression (e.g.
> ftp://user@host?password=pass&fileName=file.txt&move=done&moveFailed=error),
> but it looks like this is trying to store file instead of download it.
>
> Thanks in advance, Igor.
>
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/How-to-dynamycally-load-file-from-ftp-during-route-processing-tp5775082.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



-- 
Claus Ibsen
-----------------
http://davsclaus.com @davsclaus
Camel in Action 2: https://www.manning.com/ibsen2