You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@servicemix.apache.org by pradet <pd...@gmail.com> on 2012/08/23 11:07:36 UTC
Property file reading dynamically in Blueprint
Hi,
I have a property file that I am reading in my blueprint XML file.
ex:
my_host=http://dummyUrl
In my route I am have used the <simple> tag to look up the property file.
In 1st scenario: When i hardcode the kay name in my route. The property file
is reading successfully.
<setHeader
headerName="myHeader"><simple>properties:my_host</simple></setHeader>
In 2nd scenario: I am trying to get this KEY from an HTTP query parameter.
And, passsing this as a key to the <simple> expression dynamically.
<setHeader
headerName="myHeader"><simple>${properties:${in.header.name}_host}</simple></setHeader>
In the 2nd scenario its not reading the property file. When I check the
logs. Only the HTTP query parameter is replaced while running, its not
reading the key.
14:33:14,368 | INFO | qtp14054126-5682 | Tracer |
? ? | 89 -
org.apache.camel.camel-core - 2.8.0.fuse-06-11 |
ID-PC103429-63993-1345549755474-82-1 >>> (route83) setHeader[myHeader]
--> log[The property value is: ${in.header.myHeader}] <<< Pattern:InOut,
Headers:{CamelHttpServletResponse=HTTP/1.1 200
14:33:14,368 | INFO | qtp14054126-5682 | route83 |
? ? | 89 -
org.apache.camel.camel-core - 2.8.0.fuse-06-11 | The property value is:
${properties:my_host}
May I know, where exactly the error is throwing.
Regards,
Pradeep
--
View this message in context: http://servicemix.396122.n5.nabble.com/Property-file-reading-dynamically-in-Blueprint-tp5714229.html
Sent from the ServiceMix - User mailing list archive at Nabble.com.
Re: Property file reading dynamically in Blueprint
Posted by pradet <pd...@gmail.com>.
Ahan!!
That's there problem.
currently we are using Camel 2.8. (2.8.0.fuse-06-11) version.
I will try with the camel 2.9 (Probably it takes time for our project to go
for 2.9 version of camel!! ).
Thanks for the help. Will revert back If I get this forward.
Regards,
Pradeep
--
View this message in context: http://servicemix.396122.n5.nabble.com/Property-file-reading-dynamically-in-Blueprint-tp5714229p5714231.html
Sent from the ServiceMix - User mailing list archive at Nabble.com.
Re: Property file reading dynamically in Blueprint
Posted by pradet <pd...@gmail.com>.
After updating our project's servicemix with Camel 2.9.2 features.
Reading property file dynamically works like charm..!!
Regards,
Pradeep
--
View this message in context: http://servicemix.396122.n5.nabble.com/Property-file-reading-dynamically-in-Blueprint-tp5714229p5714248.html
Sent from the ServiceMix - User mailing list archive at Nabble.com.
Re: Property file reading dynamically in Blueprint
Posted by pradet <pd...@gmail.com>.
Claus,
Is there an alternate way of reading the property file dynamically in
blueprint in camel 2.8 enabled servicemix ?
My project also has a constraint like, No java code reference can be used.
Can you suggest some alternate way for property file reading.
Pradeep
--
View this message in context: http://servicemix.396122.n5.nabble.com/Property-file-reading-dynamically-in-Blueprint-tp5714229p5714245.html
Sent from the ServiceMix - User mailing list archive at Nabble.com.
Re: Property file reading dynamically in Blueprint
Posted by Claus Ibsen <cl...@gmail.com>.
On Thu, Aug 23, 2012 at 11:07 AM, pradet <pd...@gmail.com> wrote:
> Hi,
>
> I have a property file that I am reading in my blueprint XML file.
>
> ex:
> my_host=http://dummyUrl
>
>
> In my route I am have used the <simple> tag to look up the property file.
>
> In 1st scenario: When i hardcode the kay name in my route. The property file
> is reading successfully.
> <setHeader
> headerName="myHeader"><simple>properties:my_host</simple></setHeader>
>
> In 2nd scenario: I am trying to get this KEY from an HTTP query parameter.
> And, passsing this as a key to the <simple> expression dynamically.
> <setHeader
> headerName="myHeader"><simple>${properties:${in.header.name}_host}</simple></setHeader>
>
You need Camel 2.9 or better to support using ${ } inside another ${ }.
> In the 2nd scenario its not reading the property file. When I check the
> logs. Only the HTTP query parameter is replaced while running, its not
> reading the key.
>
> 14:33:14,368 | INFO | qtp14054126-5682 | Tracer |
> ? ? | 89 -
> org.apache.camel.camel-core - 2.8.0.fuse-06-11 |
> ID-PC103429-63993-1345549755474-82-1 >>> (route83) setHeader[myHeader]
> --> log[The property value is: ${in.header.myHeader}] <<< Pattern:InOut,
> Headers:{CamelHttpServletResponse=HTTP/1.1 200
> 14:33:14,368 | INFO | qtp14054126-5682 | route83 |
> ? ? | 89 -
> org.apache.camel.camel-core - 2.8.0.fuse-06-11 | The property value is:
> ${properties:my_host}
>
> May I know, where exactly the error is throwing.
>
> Regards,
> Pradeep
>
>
>
>
> --
> View this message in context: http://servicemix.396122.n5.nabble.com/Property-file-reading-dynamically-in-Blueprint-tp5714229.html
> Sent from the ServiceMix - User mailing list archive at Nabble.com.
--
Claus Ibsen
-----------------
FuseSource
Email: cibsen@fusesource.com
Web: http://fusesource.com
Twitter: davsclaus, fusenews
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen