You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@camel.apache.org by Antoine DESSAIGNE <an...@gmail.com> on 2013/06/06 17:52:30 UTC

Feature request: support setOutBody in XML definitions

Hi everyone,

I didn't found the <setOutBody> XML tag and I was wondering whether there
was a reason for that ?

Otherwise, I will submit a patch for fixing this gap.

Thanks a lot,

Antoine.

Re: Feature request: support setOutBody in XML definitions

Posted by Antoine DESSAIGNE <an...@gmail.com>.
I wasn't able to find the issue you're mentioning in Jira, by any change do
you have the issue number ?

Thanks a lot,

Antoine.


2013/6/7 Claus Ibsen <cl...@gmail.com>

> Because <setBody> handles this internally as well the Camel routing engine.
>
> And there was a bug in Camel, so when you had short routes, like
>
> from X
>  setBody
>
> This is fixed in recent/upcoming releases (cant remember exact when)
>
> Also see this FAQ
> http://camel.apache.org/using-getin-or-getout-methods-on-exchange.html
>
> On Fri, Jun 7, 2013 at 9:32 AM, Antoine DESSAIGNE
> <an...@gmail.com> wrote:
> > Hi,
> >
> > Why are they deprecated ?
> >
> > I want to create a restlet consumer (see [1]) using XML, and the
> > documentation states that the response should be defined in the OUT
> message.
> >
> > As of today I was the following sample code
> >     <!-- Route used to make a restlet server -->
> >     <route>
> >         <from uri="restlet:http://localhost:8888/hello/{id}"/>
> >         <setBody>
> >             <simple>Hello ${headers[id]} !</simple>
> >         </setBody>
> >         <to uri="mock:mock" />
> >     </route>
> >
> > How can I set the response in the OUT message ?
> >
> > Also, I there a way to avoid needing <to uri="mock:mock" /> ?
> >
> > Thanks a lot for your help,
> >
> > Antoine.
> >
> > [1] http://camel.apache.org/restlet.html#Restlet-MessageBody
> >
> >
> > 2013/6/6 Claus Ibsen <cl...@gmail.com>
> >
> >> Hi
> >>
> >> Yeah all the setOut is @deprecated as you should just use setBody /
> >> setHeader etc.
> >> So this is on purpose why there is no <setOutBody> in the XML DSL
> >>
> >> On Thu, Jun 6, 2013 at 5:52 PM, Antoine DESSAIGNE
> >> <an...@gmail.com> wrote:
> >> > Hi everyone,
> >> >
> >> > I didn't found the <setOutBody> XML tag and I was wondering whether
> there
> >> > was a reason for that ?
> >> >
> >> > Otherwise, I will submit a patch for fixing this gap.
> >> >
> >> > Thanks a lot,
> >> >
> >> > Antoine.
> >>
> >>
> >>
> >> --
> >> Claus Ibsen
> >> -----------------
> >> www.camelone.org: The open source integration conference.
> >>
> >> Red Hat, Inc.
> >> FuseSource is now part of Red Hat
> >> Email: cibsen@redhat.com
> >> Web: http://fusesource.com
> >> Twitter: davsclaus
> >> Blog: http://davsclaus.com
> >> Author of Camel in Action: http://www.manning.com/ibsen
> >>
>
>
>
> --
> Claus Ibsen
> -----------------
> www.camelone.org: The open source integration conference.
>
> Red Hat, Inc.
> FuseSource is now part of Red Hat
> Email: cibsen@redhat.com
> Web: http://fusesource.com
> Twitter: davsclaus
> Blog: http://davsclaus.com
> Author of Camel in Action: http://www.manning.com/ibsen
>

Re: Feature request: support setOutBody in XML definitions

Posted by Claus Ibsen <cl...@gmail.com>.
Because <setBody> handles this internally as well the Camel routing engine.

And there was a bug in Camel, so when you had short routes, like

from X
 setBody

This is fixed in recent/upcoming releases (cant remember exact when)

Also see this FAQ
http://camel.apache.org/using-getin-or-getout-methods-on-exchange.html

On Fri, Jun 7, 2013 at 9:32 AM, Antoine DESSAIGNE
<an...@gmail.com> wrote:
> Hi,
>
> Why are they deprecated ?
>
> I want to create a restlet consumer (see [1]) using XML, and the
> documentation states that the response should be defined in the OUT message.
>
> As of today I was the following sample code
>     <!-- Route used to make a restlet server -->
>     <route>
>         <from uri="restlet:http://localhost:8888/hello/{id}"/>
>         <setBody>
>             <simple>Hello ${headers[id]} !</simple>
>         </setBody>
>         <to uri="mock:mock" />
>     </route>
>
> How can I set the response in the OUT message ?
>
> Also, I there a way to avoid needing <to uri="mock:mock" /> ?
>
> Thanks a lot for your help,
>
> Antoine.
>
> [1] http://camel.apache.org/restlet.html#Restlet-MessageBody
>
>
> 2013/6/6 Claus Ibsen <cl...@gmail.com>
>
>> Hi
>>
>> Yeah all the setOut is @deprecated as you should just use setBody /
>> setHeader etc.
>> So this is on purpose why there is no <setOutBody> in the XML DSL
>>
>> On Thu, Jun 6, 2013 at 5:52 PM, Antoine DESSAIGNE
>> <an...@gmail.com> wrote:
>> > Hi everyone,
>> >
>> > I didn't found the <setOutBody> XML tag and I was wondering whether there
>> > was a reason for that ?
>> >
>> > Otherwise, I will submit a patch for fixing this gap.
>> >
>> > Thanks a lot,
>> >
>> > Antoine.
>>
>>
>>
>> --
>> Claus Ibsen
>> -----------------
>> www.camelone.org: The open source integration conference.
>>
>> Red Hat, Inc.
>> FuseSource is now part of Red Hat
>> Email: cibsen@redhat.com
>> Web: http://fusesource.com
>> Twitter: davsclaus
>> Blog: http://davsclaus.com
>> Author of Camel in Action: http://www.manning.com/ibsen
>>



-- 
Claus Ibsen
-----------------
www.camelone.org: The open source integration conference.

Red Hat, Inc.
FuseSource is now part of Red Hat
Email: cibsen@redhat.com
Web: http://fusesource.com
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen

Re: Feature request: support setOutBody in XML definitions

Posted by Antoine DESSAIGNE <an...@gmail.com>.
Hi,

Why are they deprecated ?

I want to create a restlet consumer (see [1]) using XML, and the
documentation states that the response should be defined in the OUT message.

As of today I was the following sample code
    <!-- Route used to make a restlet server -->
    <route>
        <from uri="restlet:http://localhost:8888/hello/{id}"/>
        <setBody>
            <simple>Hello ${headers[id]} !</simple>
        </setBody>
        <to uri="mock:mock" />
    </route>

How can I set the response in the OUT message ?

Also, I there a way to avoid needing <to uri="mock:mock" /> ?

Thanks a lot for your help,

Antoine.

[1] http://camel.apache.org/restlet.html#Restlet-MessageBody


2013/6/6 Claus Ibsen <cl...@gmail.com>

> Hi
>
> Yeah all the setOut is @deprecated as you should just use setBody /
> setHeader etc.
> So this is on purpose why there is no <setOutBody> in the XML DSL
>
> On Thu, Jun 6, 2013 at 5:52 PM, Antoine DESSAIGNE
> <an...@gmail.com> wrote:
> > Hi everyone,
> >
> > I didn't found the <setOutBody> XML tag and I was wondering whether there
> > was a reason for that ?
> >
> > Otherwise, I will submit a patch for fixing this gap.
> >
> > Thanks a lot,
> >
> > Antoine.
>
>
>
> --
> Claus Ibsen
> -----------------
> www.camelone.org: The open source integration conference.
>
> Red Hat, Inc.
> FuseSource is now part of Red Hat
> Email: cibsen@redhat.com
> Web: http://fusesource.com
> Twitter: davsclaus
> Blog: http://davsclaus.com
> Author of Camel in Action: http://www.manning.com/ibsen
>

Re: Feature request: support setOutBody in XML definitions

Posted by Claus Ibsen <cl...@gmail.com>.
Hi

Yeah all the setOut is @deprecated as you should just use setBody /
setHeader etc.
So this is on purpose why there is no <setOutBody> in the XML DSL

On Thu, Jun 6, 2013 at 5:52 PM, Antoine DESSAIGNE
<an...@gmail.com> wrote:
> Hi everyone,
>
> I didn't found the <setOutBody> XML tag and I was wondering whether there
> was a reason for that ?
>
> Otherwise, I will submit a patch for fixing this gap.
>
> Thanks a lot,
>
> Antoine.



-- 
Claus Ibsen
-----------------
www.camelone.org: The open source integration conference.

Red Hat, Inc.
FuseSource is now part of Red Hat
Email: cibsen@redhat.com
Web: http://fusesource.com
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen