【发布时间】:2014-03-26 22:59:11
【问题描述】:
我正在尝试在骆驼路线中使用属性占位符。 我有定义属性的 test.properties:MQ.queuename1=TESTQUEUE。 在骆驼上下文中,我定义占位符:
<camel:camelContext xmlns="http://camel.apache.org/schema/spring" >
<propertyPlaceholder id="camel-properties" location="file:${web.external.propdir}/test.properties"/>
在路由中,我使用简单的表达式来评估属性:
<choice>
<when>
<simple>${in.header.queuename} == '{{MQ.queuename1}}'</simple>
<bean ref="ExtractOrderContent" method="extractContent"/>
<to uri="websphere-mq:queue:TESTQUEUE" pattern="InOnly"/>
</when>
</choice>
当我运行骆驼时,属性文件被骆驼识别,但看起来简单的表达式不起作用。我有什么想念的吗?
【问题讨论】:
-
你用的是什么版本的骆驼?
-
骆驼版本是2.8.4。由于其他项目的一些限制,我无法升级到较新的骆驼。
-
我认为它有一个错误,所以 {{ }} 在使用
时不起作用
标签: spring properties expression apache-camel placeholder