2008/6/23 Claus Ibsen <[EMAIL PROTECTED]>:
> Hi
>
> In the file component (FileProducer)
>
> FileProducer (for writing files) has some strange code:
>
>  public void process(FileExchange exchange) throws Exception {
>        if (ExchangeHelper.isOutCapable(exchange)) {
>            // lets poll the file
>            Message out = exchange.getOut(true);
>            endpoint.configureMessage(endpoint.getFile(), out);
>            return;
>        }
>
>        ...
>        Normal code to do the writing of the in body
>
>
> The code above will for all Out capable exchanges (eg InOut) poll a file 
> instead.
>
> I haven't digged deeper yet, but I wanted to hear if anyone knows the reason 
> for this code.
>
> See the unit test in camel-jetty component HttpToFileTest that demonstrates a 
> user request on the forum how to save http requests to files.
> I needed to change the exchange pattern to in only to avoid the strange code 
> above to kick in.
>
> As I haven't had my 3rd cup of morning coffee yet I am in a state where I 
> can't read the code to well to understand the holy reason for it ;)
>
>
> See also user forum for the user request:
> http://www.nabble.com/from-http%3A--...-to-file%3A--...-td17739149s22882.html

I'm still only midway through my first cup :) I've got a hazy memory
of it being to do with file polling; but then I'd have thought this
would have been in the consumer not the producer side?

-- 
James
-------
http://macstrac.blogspot.com/

Open Source Integration
http://open.iona.com

Reply via email to