是否可以將消息頭設置爲從屬性文件中讀取的值,使用駱駝屬性組件?我可以將這些屬性設置爲URI選項,但我無法將它們設置爲標題值。如何在Apache Camel中將頭設置爲屬性文件中的值
我需要的是這樣的:
<camel:setHeader headerName="actionId">
<camel:constant>{{onus.transPosting.RtSFailed}}</camel:constant>
</camel:setHeader>
其中onus.transPosting.RtSFailed
是屬性鍵上的文件設置使用進口駱駝屬性組件。
注:我使用Apache的駱駝2.10.1
UPDATE
使用<propertyPlaceholder>
通過this discussion的建議沒有工作,它會導致異常:
Caused by: org.apache.camel.language.simple.types.SimpleParserException: Unknown function: onus.transPosting.RtSFailed
' $ {onus.transPosting.RtsFailed} '不起作用? (和Apache Camel一樣沒有經驗) –
不,它不是:( –
看到這個討論:http://camel.465427.n5.nabble.com/using-values-from-a-properties-file-in -setHeader-method-td5154287.html –