You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by Sadanand Kusma <sk...@ARCCorp.com> on 2011/09/09 17:38:29 UTC

variables

Hi,

I am wondering if there is a way to declare/use request scoped variables in camel 2.x which runs on jdk1.5. This is the case where we want to create a variable at the at any point of the route and use it in later part of the route, it should be request scoped. I can think of using header for this, but this header is being passed to the components. I am using camel in webapp.

Thanks,
Sadanand

Re: variables

Posted by Romain Manni-Bucau <rm...@gmail.com>.
Hi,

headers or properties are a good solutions. Just take care headers can be
lost between 2 components.

- Romain

2011/9/9 Sadanand Kusma <sk...@arccorp.com>

> Hi,
>
> I am wondering if there is a way to declare/use request scoped variables in
> camel 2.x which runs on jdk1.5. This is the case where we want to create a
> variable at the at any point of the route and use it in later part of the
> route, it should be request scoped. I can think of using header for this,
> but this header is being passed to the components. I am using camel in
> webapp.
>
> Thanks,
> Sadanand
>

Re: variables

Posted by Claus Ibsen <cl...@gmail.com>.
On Fri, Sep 9, 2011 at 5:38 PM, Sadanand Kusma <sk...@arccorp.com> wrote:
> Hi,
>
> I am wondering if there is a way to declare/use request scoped variables in camel 2.x which runs on jdk1.5. This is the case where we want to create a variable at the at any point of the route and use it in later part of the route, it should be request scoped. I can think of using header for this, but this header is being passed to the components. I am using camel in webapp.
>

You can store information as properties on the Exchange. Then they are
"request scoped" as they live for the duration of the Exchange.

> Thanks,
> Sadanand
>



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