camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Claus Ibsen <claus.ib...@gmail.com>
Subject Re: How to set multiple properties to camel route dynamically
Date Wed, 09 Sep 2015 14:46:07 GMT
The configure method is only invoked once to setup the route before its started.

If you need to per message at runtime to set data on the message from
that hashmap, then use a Camel Processor or Java Bean to set those.



On Wed, Sep 9, 2015 at 8:23 AM, sivaram <pvsivarammca@gmail.com> wrote:
> Hi All,
>
>  I am a newbie to Apache Camel. I have created a Java DSL by extending
> RouteBuilder class and defined route like below :
>
>    Class MyRoute extends RouteBuilder
> {
>      public void configure()
>     {
>           from(from)
>          .setProperty(name, constant(headerName))
>          .to(DIRECT_VALIDATE_FLOW);
>
>     }
> }
> I have a hashmap property in the class to which a hashmap with key and value
> pairs will be injected.
>
> My requirement is that I have to dynamically add key value pairs in the
> hashmap as setProperty(key, value).
>
> Normally I have to loop through map and dynamically add .setProperty()
> values.
> Don't know how to achieve this. Searched on web but didn't find any help.
>
> Please guide me in this regard.
>
>
> Regards,
> Siva Ram.
>
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/How-to-set-multiple-properties-to-camel-route-dynamically-tp5771367.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



-- 
Claus Ibsen
-----------------
http://davsclaus.com @davsclaus
Camel in Action 2nd edition:
https://www.manning.com/books/camel-in-action-second-edition

Mime
View raw message