我有属性文件,我想通过这个文件在我的路由中设置 uri:
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
http://camel.apache.org/schema/spring http://camel.apache.org/schema/spring/camel-spring.xsd">
<import resource="TransactionsParserConfig.xml"/>
<bean id="transactionsValidator" class="com.class.TransactionsValidator"/>
<bean id="transactionsValidator123" name="${ftp.host}"/> <!--here I can use property-->
<routeContext id="transactionsRoutes" xmlns="http://camel.apache.org/schema/spring">
<route id="routeFTP">
<from uri="direct:start" />
<!--here I can NOT use property-->
<from uri="ftps://${ftp.host}/?securityProtocol=SSL"/>
etc...
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd">
<bean class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
<property name="locations">
<array>
<value>classpath:/ftp.properties</value>
</array>
</property>
</bean>
</beans>
但看起来不允许从属性文件设置 uri。因为当我在 routexContext 标记之外使用 ${ftp.host} 时,一切都很好。当我在 routeContext 中点击 ctrl+mouseclick 时,即使是 Idea 也无法重定向我。为什么?