|
I am trying to read a property with dynamic property key
i have property like 1234_host=<hostname> 1234_port=<port> where "1234" is group code, and it it dynamic, i will extract it from input file i receive and consume service running at this host i have configuration like <route> <from uri="file://inputfolder/" /> <bean ref="extractGroupAndSetInHeader" /> <setHeader headerName="groupHost"> <constant>{{${in.header.groupID}_host}}</constant> </setHeader> <setHeader headerName="groupPort"> <constant>{{${in.header.groupID}_port}}</constant> </setHeader> <recipientList> <simple>cxfrs://http://${header.groupHost}:${header.groupPort}/item/${in.header.itemId}</simple> </recipientList> </route> But reading property with dynamic key does not works this way. Can someone please help me about how to read properties with dynamic keys in camel spring DSL. Thanks and Regards, Paramjyot Singh |
|
On Wed, Jun 13, 2012 at 7:29 PM, paramjyotsingh <[hidden email]>wrote:
> I am trying to read a property with dynamic property key > > i have property like > > 1234_host=<hostname> > 1234_port=<port> > > where "1234" is group code, and it it dynamic, i will extract it from input > file i receive and consume service running at this host > > i have configuration like > > <route> > <from uri="file://inputfolder/" /> > <bean ref="extractGroupAndSetInHeader" /> > <setHeader headerName="groupHost"> > <constant>{{${in.header.groupID}_host}}</constant> > </setHeader> > <setHeader headerName="groupPort"> > <constant>{{${in.header.groupID}_port}}</constant> > </setHeader> > <recipientList> > > <simple>${properties:${header.groupID}_host}</simple> > <simple>cxfrs://http:// > ${header.groupHost}:${header.groupPort}/item/${in.header.itemId}</simple> > </recipientList> > </route> > > But reading property with dynamic key does not works this way. > > Can someone please help me about how to read properties with dynamic keys > in > camel spring DSL. > > Thanks and Regards, > Paramjyot Singh > > -- > View this message in context: > http://camel.465427.n5.nabble.com/dynamic-property-keys-tp5714449.html > Sent from the Camel - Users mailing list archive at Nabble.com. > -- Claus Ibsen ----------------- FuseSource Email: [hidden email] Web: http://fusesource.com Twitter: davsclaus, fusenews Blog: http://davsclaus.com Author of Camel in Action: http://www.manning.com/ibsen |
|
Thanks Claus It works ...
|
|
Hi Claus,
In different system I have camel 2.8.1, and i am getting error while executing same configuration on that version. Can you please tell me this does not work in camel 2.8.1. |
|
This post was updated on .
Hey Claus,
I looked at the documentation it says that nested expressions are not supported in 2.8.X and older. Can you please suggest any work around for this scenario. Thanks and Regards, Paramjyot Singh |
|
On Mon, Jun 25, 2012 at 7:40 PM, paramjyotsingh
<[hidden email]> wrote: > Hey Clause, > > I looked at the documentation it says that nested expressions are not > supported in 2.8.X and older. Can you please suggest any work around for > this scenario. > You can use a java bean / processor, and then there is any API on CamelContext to resolve property placeholders http://camel.apache.org/maven/current/camel-core/apidocs/org/apache/camel/CamelContext.html#resolvePropertyPlaceholders(java.lang.String) Then you can lookup the placeholders 2 times as nested are still not supported. But then you can do this manually in some java code. And then in the <setHeader> you can use a <bean> expression to call your bean / processor. > Thanks and Regards, > Paramjyot Singh > > -- > View this message in context: http://camel.465427.n5.nabble.com/dynamic-property-keys-tp5714449p5715074.html > Sent from the Camel - Users mailing list archive at Nabble.com. -- Claus Ibsen ----------------- FuseSource Email: [hidden email] Web: http://fusesource.com Twitter: davsclaus, fusenews Blog: http://davsclaus.com Author of Camel in Action: http://www.manning.com/ibsen |
| Powered by Nabble | Edit this page |
