Apache camel 如何在ApacheCamel中定义spring dsl中的属性
如何使用Apache camel 如何在ApacheCamel中定义spring dsl中的属性,apache-camel,apache-servicemix,property-placeholder,camel-cxf,Apache Camel,Apache Servicemix,Property Placeholder,Camel Cxf,如何使用apachecamel中的springdsl定义属性?使用Blueprint,您可以通过以下方式完成: <cm:property-placeholder persistent-id="org.apache.servicemix.examples.cxf.receive" update-strategy="reload"> <cm:default-properties> <cm:property name="CXFse
apachecamel
中的springdsl
定义属性?使用Blueprint,您可以通过以下方式完成:
<cm:property-placeholder persistent-id="org.apache.servicemix.examples.cxf.receive" update-strategy="reload">
<cm:default-properties>
<cm:property name="CXFserver" value="http://localhost:8989/"/>
<cm:property name="service" value="soap" />
</cm:default-properties>
</cm:property-placeholder>
<camelcxf:cxfEndpoint id="personService"
address="${CXFserver}${service}"
serviceClass="org.apache.servicemix.examples.camel.soap.PersonService"
/>
与PropertyPlaceholderConfigurer类似
<bean class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
<property name="properties">
<props>
<prop key="CXFserver">http://localhost:8989/</prop>
<prop key="service">soap</prop>
</props>
</property>
</bean>
http://localhost:8989/
肥皂
与PropertyPlaceHolderConfiguration类似
<bean class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
<property name="properties">
<props>
<prop key="CXFserver">http://localhost:8989/</prop>
<prop key="service">soap</prop>
</props>
</property>
</bean>
http://localhost:8989/
肥皂
请参阅文档:在SpringXML中配置一节中请参阅文档:在SpringXML中配置一节中,您正在尝试在服务器中获取属性,我从未尝试过这样做。但是您可以尝试在属性文件是本地文件时执行类似的操作,如下图所示
<bean
class="org.apache.camel.component.properties.PropertiesComponent" id="properties">
<property name="location" value="classpath:application.properties"/>
</bean>
在类路径中,您可以尝试将类路径更改为服务器地址。您尝试在服务器中获取属性,我从未尝试过这样做。但是您可以尝试在属性文件是本地文件时执行类似的操作,如下图所示
<bean
class="org.apache.camel.component.properties.PropertiesComponent" id="properties">
<property name="location" value="classpath:application.properties"/>
</bean>
在类路径中,您可以尝试将类路径更改为服务器地址