是否可以将消息头设置为从属性文件中读取的值,使用骆驼属性组件?我可以将这些属性设置为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 –