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