I am trying to using property placeholder in camel route. I have test.properties which define property: MQ.queuename1=TESTQUEUE. In camel context, i define placeholder:
<camel:camelContext xmlns="http://camel.apache.org/schema/spring" >
<propertyPlaceholder id="camel-properties" location="file:${web.external.propdir}/test.properties"/>
In the route, i use simple expresion to evaluate the property:
<choice>
<when>
<simple>${in.header.queuename} == '{{MQ.queuename1}}'</simple>
<bean ref="ExtractOrderContent" method="extractContent"/>
<to uri="websphere-mq:queue:TESTQUEUE" pattern="InOnly"/>
</when>
</choice>
When i run camel, the property file is recognized by camel but it looks like the simple expression doesn't work. Do i miss anything?
You can use the properties function from simple (http://camel.apache.org/simple)
<simple>${in.header.queuename} == ${properties:MQ.queuename1}</simple>
The {{ }} in nested < when > is likely due to a bug, that has been fixed in newer Camel releases.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With