Apache Camel读取配置文件

来源:互联网 发布:淘宝港澳台运费设置 编辑:程序博客网 时间:2024/06/05 23:55

方法一

<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>