-2
我試圖通過使用Apache Camel條件路由來傳輸文件。條件是如果文件名以「041PACS」開頭。它在源文件夾上創建了一個.camel目錄。但不知道爲什麼文件沒有傳輸到目標文件夾。控制檯中沒有錯誤。Apache Camel條件路由不起作用
我使用的是Camel 2.17.3和JDK 1.7。
的applicationContext.xml
<?xml version="1.0" encoding="UTF-8"?>
<beans default-autowire="byName"
xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:p="http://www.springframework.org/schema/p" xmlns:tx="http://www.springframework.org/schema/tx"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:util="http://www.springframework.org/schema/util"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.1.xsd
http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-3.1.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.1.xsd
http://camel.apache.org/schema/spring http://camel.apache.org/schema/spring/camel-spring-2.17.3.xsd
http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-3.0.xsd">
<import resource="actionRoutes.xml" />
<camelContext streamCache="true"
xmlns="http://camel.apache.org/schema/spring">
<package>in.client.camelbean</package>
<routeContextRef ref="actionRoutes" />
</camelContext>
</beans>
actionRoutes.xml
<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-3.1.xsd
http://camel.apache.org/schema/spring http://camel.apache.org/schema/spring/camel-spring-2.17.3.xsd ">
<!-- Only the routeContext is here -->
<routeContext id="actionRoutes" xmlns="http://camel.apache.org/schema/spring">
<route id="route36">
<from uri="file:\\home\41\CAMEL\reports" />
<choice>
<when>
<simple>${header.CamelFileName.startsWith("041PACS")} == 'true'</simple>
<to uri="file:\\home\41\CAMEL\result?noop=true" />
</when>
</choice>
</route>
</routeContext>
</beans>
@ halfer ..你爲什麼要編輯我的文章? – shubho