You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@camel.apache.org by William Tam <em...@gmail.com> on 2007/10/03 04:49:15 UTC

CamelTemplate.extractResultBody question

In org.apache.camel.CamelTemplate, shouldn't it just return null if
result.getOut().getBody() is null?  Why does it return the IN body as
a result?


   protected Object extractResultBody(E result) {
        Object answer = null;
        if (result != null) {
            answer = result.getOut().getBody();
            if (answer == null) {
                answer = result.getIn().getBody();
            }
        }

Regards,
William

Re: CamelTemplate.extractResultBody question

Posted by James Strachan <ja...@gmail.com>.
On 03/10/2007, William Tam <em...@gmail.com> wrote:
> In org.apache.camel.CamelTemplate, shouldn't it just return null if
> result.getOut().getBody() is null?  Why does it return the IN body as
> a result?
>
>
>    protected Object extractResultBody(E result) {
>         Object answer = null;
>         if (result != null) {
>             answer = result.getOut().getBody();
>             if (answer == null) {
>                 answer = result.getIn().getBody();
>             }
>         }

Now we have the message exchange pattern stuff integrated it might;
previously a Processor could have mutated an IN message; or could have
generated an OUT message and so it was hard to work with both kinds of
processors nicely.

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

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