Apache Camel读取配置文件

来源:互联网 发布:淘宝联盟返利网 编辑:程序博客网 时间:2024/06/09 20:26

方法一:

<camelContext id="camelContext" xmlns="http://camel.apache.org/schema/spring"><propertyPlaceholder id="properties" location="file:e:/tmp/http.cfg" /><route><from uri="direct://start1" /><log message="java.runtime.version : {{java.runtime.version}}" /><log message="this is http.address : {{http.address}}" /><log message="this is http.context.path : {{http.context.path}}" /></route></camelContext>


方法二:

<bean id="properties" class="org.apache.camel.component.properties.PropertiesComponent">    <property name="location" value="file:e:/tmp/http.cfg"/></bean>

引用属性和上面的方法一样



camel版本:2.14.1

7 0
原创粉丝点击