camel 中用于速度模板的系统 属性 使用默认值,而不是环境级别设置
System property used in camel for velocity template uses default value, not environment-level setting
我正在使用 Spring 和 Camel 进行小型服务。两者都在多个位置绘制属性文件,包括在服务器启动配置中指定的特定于环境的设置文件。
Spring:
<context:property-placeholder
location="classpath*:config/*.properties,classpath:config/*.properties, file:${application.properties.file}"/>
骆驼语境:
<propertyPlaceholder id="properties" location="classpath:config/camel-constant.properties,
config/application.properties, file:${application.properties.file}"/>
这似乎适用于端点配置:
<endpoint id="supplierEmail" uri="smtp:${mailsender.host}?contentType=text/html"/>
但我想在我的速度模板中访问 属性。如果我尝试
<setHeader headerName="environment_id">
<simple>${properties:environment.id}</simple>
</setHeader>
$headers.environment_id in velocity template 选择了一个值,但它是默认值,而不是来自环境级别属性文件的值。
我错过了什么?
抱歉,忽略。配置指向错误的翻转文件。
我正在使用 Spring 和 Camel 进行小型服务。两者都在多个位置绘制属性文件,包括在服务器启动配置中指定的特定于环境的设置文件。
Spring:
<context:property-placeholder
location="classpath*:config/*.properties,classpath:config/*.properties, file:${application.properties.file}"/>
骆驼语境:
<propertyPlaceholder id="properties" location="classpath:config/camel-constant.properties,
config/application.properties, file:${application.properties.file}"/>
这似乎适用于端点配置:
<endpoint id="supplierEmail" uri="smtp:${mailsender.host}?contentType=text/html"/>
但我想在我的速度模板中访问 属性。如果我尝试
<setHeader headerName="environment_id">
<simple>${properties:environment.id}</simple>
</setHeader>
$headers.environment_id in velocity template 选择了一个值,但它是默认值,而不是来自环境级别属性文件的值。
我错过了什么?
抱歉,忽略。配置指向错误的翻转文件。