Properties 解析Camel中属性占位符提供的${karaf.home}

Properties 解析Camel中属性占位符提供的${karaf.home},properties,apache-camel,apache-karaf,properties-file,Properties,Apache Camel,Apache Karaf,Properties File,我正在尝试为属性中的PGP加密密钥提供文件路径 .setHeader("CamelPGPDataFormatKeyFileName") .constant("file:{{devo_keyringUri}}") {{devo_keyringUri}的定义类似于${karaf.base}/etc/devKeyring.gpg 我假设${karaf.base}将由属性组件解析,但它不起作用。我得到一个java.io.FileNotFoundException-${karaf.base}/etc/d

我正在尝试为属性中的PGP加密密钥提供文件路径

.setHeader("CamelPGPDataFormatKeyFileName")
.constant("file:{{devo_keyringUri}}")
{{devo_keyringUri}
的定义类似于
${karaf.base}/etc/devKeyring.gpg

我假设
${karaf.base}
将由属性组件解析,但它不起作用。我得到一个
java.io.FileNotFoundException-${karaf.base}/etc/devKeyring.gpg

因此,它解析占位符,但不解析“嵌套”变量

要在
${karaf.base}
中获得解析路径,我需要做什么

Camel Version is 2.13.2
Karaf Version is 2.3.9
编辑

它也不适用于较新的版本:

Camel Version is 2.15.3
Karaf Version is 4.0.1
Constant()不是这里正确的方法。试试这个:

setHeader("CamelPGPDataFormatKeyFileName", simple("file:${properties:devo_keyringUri}")

更多信息。

尝试升级旧版骆驼version@ClausIbsen谢谢你的提示。现在在Karaf 4.0.1上使用Camel 2.15.3进行了尝试,但也没有成功(结果与描述的相同)。使用
{sys:Karaf.base}}/etc/devKeyring.gpg进行了尝试,我使用simple language进行了尝试,但没有解决问题(结果相同)。您确定您的通配符表达式正确吗?不要使用{{}符号。