Is it possible to set a message header to a value read from a properties file, using the camel Properties Component? I can set such properties to URI options, but I'm unable to set them as a header values.
I need something like this:
<camel:setHeader headerName="actionId">
<camel:constant>{{onus.transPosting.RtSFailed}}</camel:constant>
</camel:setHeader>
where onus.transPosting.RtSFailed
is a property key set on a file imported using camel Properties Component.
Note: I'm using Apache Camel 2.10.1
UPDATE
Using the <propertyPlaceholder>
as suggested by this discussion did not work and it causes an exception:
Caused by: org.apache.camel.language.simple.types.SimpleParserException: Unknown function: onus.transPosting.RtSFailed
Yes you can, use the simple language which has a properties function: http://camel.apache.org/simple
<camel:setHeader headerName="actionId">
<camel:simple>${properties:onus.transPosting.RtSFailed}</camel:simple>
</camel:setHeader>
Though I think we have fixed in latest Camel releases that < camel:constant > will resolve property placeholders as well.
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