You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by sabretooth <sa...@gmail.com> on 2013/02/21 18:23:03 UTC
Setting body attributes
Hi there,
I am new to camel, I wanted to know about setting body attributes using
apache Camel in spring DSL
Like if in my body there is a attribute for Admin Id i represent it as
${body.adminId} . What if i have
to set a constant value to it (like ADM01 or TEC02 etc.) How can i do this
using only Apache camel .
I dont want to use any POJO or processor or anything like this. I want it to
be done in spring DSL only.
Its as simple as doing it in java : public static final int MY_BDATE = 10;
Can somebody help.................... Sorry for a premature question like
this , but everybody was using an external POJO or processors for doing
this...
Thanks
--
View this message in context: http://camel.465427.n5.nabble.com/Setting-body-attributes-tp5727970.html
Sent from the Camel - Users mailing list archive at Nabble.com.
Re: Setting body attributes
Posted by sabretooth <sa...@gmail.com>.
Ok thanks
--
View this message in context: http://camel.465427.n5.nabble.com/Setting-body-attributes-tp5727970p5728042.html
Sent from the Camel - Users mailing list archive at Nabble.com.
Re: Setting body attributes
Posted by Willem jiang <wi...@gmail.com>.
You can set the message header wit the constant, but I don't think you can set the attribute of the Java object in your message body like that with Spring DSL.
--
Willem Jiang
Red Hat, Inc.
FuseSource is now part of Red Hat
Web: http://www.fusesource.com | http://www.redhat.com
Blog: http://willemjiang.blogspot.com (http://willemjiang.blogspot.com/) (English)
http://jnn.iteye.com (http://jnn.javaeye.com/) (Chinese)
Twitter: willemjiang
Weibo: 姜宁willem
On Friday, February 22, 2013 at 1:23 AM, sabretooth wrote:
> Hi there,
>
> I am new to camel, I wanted to know about setting body attributes using
> apache Camel in spring DSL
>
> Like if in my body there is a attribute for Admin Id i represent it as
> ${body.adminId} . What if i have
> to set a constant value to it (like ADM01 or TEC02 etc.) How can i do this
> using only Apache camel .
> I dont want to use any POJO or processor or anything like this. I want it to
> be done in spring DSL only.
>
> Its as simple as doing it in java : public static final int MY_BDATE = 10;
>
> Can somebody help.................... Sorry for a premature question like
> this , but everybody was using an external POJO or processors for doing
> this...
>
>
> Thanks
>
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/Setting-body-attributes-tp5727970.html
> Sent from the Camel - Users mailing list archive at Nabble.com (http://Nabble.com).
Re: Setting body attributes
Posted by Claus Ibsen <cl...@gmail.com>.
Hi
You can use some of the expression languages which may support this,
such as Groovy, SpEL, MVel etc.
http://camel.apache.org/languages.html
>From Camel 2.11 onwards the simple expression language (from
camel-core) supports using types as well, using the new type function.
http://camel.apache.org/simple
On Thu, Feb 21, 2013 at 6:23 PM, sabretooth <sa...@gmail.com> wrote:
> Hi there,
>
> I am new to camel, I wanted to know about setting body attributes using
> apache Camel in spring DSL
>
> Like if in my body there is a attribute for Admin Id i represent it as
> ${body.adminId} . What if i have
> to set a constant value to it (like ADM01 or TEC02 etc.) How can i do this
> using only Apache camel .
> I dont want to use any POJO or processor or anything like this. I want it to
> be done in spring DSL only.
>
> Its as simple as doing it in java : public static final int MY_BDATE = 10;
>
> Can somebody help.................... Sorry for a premature question like
> this , but everybody was using an external POJO or processors for doing
> this...
>
>
> Thanks
>
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/Setting-body-attributes-tp5727970.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
--
Claus Ibsen
-----------------
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