camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Claus Ibsen <claus.ib...@gmail.com>
Subject Re: Using ConsumerTemplate to fetch files.
Date Tue, 14 Dec 2010 15:42:49 GMT
I have created a ticket to make this easier using the ConsumerTemplate API
https://issues.apache.org/jira/browse/CAMEL-3427

Check the source code in trunk, how to do it in your Camel version.


On Tue, Dec 14, 2010 at 4:39 PM, Andreas A. <andreasasmuss@gmail.com> wrote:
>
> Can't find anything along those lines. I tried doing
>
> while(true) {
>        Exchange ex = consumer.receive(ftpsUri, 5000);
>        if(ex != null) {
>                logger.info("Fetching file: " + ex.getIn().getHeader("CamelFileName"));
>                producer.send(fileUri, ex);
>                ex.getUnitOfWork().done(ex);
>        }
>        else if (ex == null) {
>                consumer.stop();
>                break;
>        }
> }
>
> But this just throws nullpointer, I suppose the exchange doesn't have a unit
> of work.
> --
> View this message in context: http://camel.465427.n5.nabble.com/Using-ConsumerTemplate-to-fetch-files-tp3304671p3304768.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>



-- 
Claus Ibsen
-----------------
FuseSource
Email: cibsen@fusesource.com
Web: http://fusesource.com
Twitter: davsclaus
Blog: http://davsclaus.blogspot.com/
Author of Camel in Action: http://www.manning.com/ibsen/

Mime
View raw message