【发布时间】:2020-07-20 19:31:40
【问题描述】:
如何将 uri 替换为配置文件 myprops.cfg 中的文本?
<route id="camel-http-proxy2">
<from uri="jetty://http://127.0.0.1:5555/mock"/>
</route>
myprops.cfg:
myuri=http://127.0.0.1:555/mock
我的尝试:
<route id="camel-http-proxy2">
<from uri="jetty://${myuri}"/>
</route>
然后骆驼按原样读取uri,它不会用属性的值替换它。
再试一次:
<endpoint id="input1" uri="jetty//${myuri}"/>
<route id="camel-http-proxy2">
<from uri="ref:input1"/>
</route>
错误:
org.osgi.service.blueprint.container.ComponentDefinitionException: 无法验证 xml org.xml.sax.SAXParseException:cvc-complex-type.2.4.a:发现以元素“{”http://camel.apache.org/schema/blueprint“:endpoint}”开头的无效内容。需要 '{"http://camel.apache.org/schema/blueprint":route}' 之一。
【问题讨论】:
标签: java xml spring apache-camel