ファイルを行ごとに解析する必要があります。各行は、スプリッターコンポーネントを使用して個別に処理されます。すべての行が処理された後、ファイルをdone_folderにコピーする必要があります。すべての行が正しく処理されていれば、すべて正常に機能します。しかし、間違った行があった場合、ロールバックとファイルがdone_folderにコピーされないという警告が表示されます。警告:
WARN (Camel (com.company.realcardparser) thread #0 - file://project/src/test/resources/working_folder) [GenericFileOnCompletion] Rollback file strategy: org.apache.camel.component.file.strategy.GenericFileDeleteProcessStrategy@41a7d9e7 for file: GenericFile[237file09062012-qa.csv]
私のラクダの設定:
<camelContext id="com.company.realcardparser" xmlns="http://camel.apache.org/schema/spring" trace="true">
<routeContextRef ref="idtProxyRoute"/>
<endpoint id="fileParserInputEndPoint" uri="file:${idt.proxy.real.card.parser.folder.test.input}?delete=true&readLock=${idt.proxy.real.card.parser.readLock}&readLockCheckInterval=${idt.proxy.real.card.parser.readLockCheckInterval}&readLockTimeout=${idt.proxy.real.card.parser.readLockTimeout}&delay=${idt.proxy.real.card.parser.delay}"/>
<endpoint id="fileParserOutputEndPoint" uri="file:${idt.proxy.real.card.parser.folder.test.output}"/>
<endpoint id="fileParserOutputFailedEndPoint" uri="file:${idt.proxy.real.card.parser.folder.test.output.failed}"/>
</camelContext>
<bean id="idtTxRequired" class="org.apache.camel.spring.spi.SpringTransactionPolicy">
<property name="transactionManager" ref="transactionManager"/>
<property name="propagationBehaviorName" value="PROPAGATION_REQUIRES_NEW"/>
</bean>
<routeContext id="idtProxyRoute" xmlns="http://camel.apache.org/schema/spring">
<route id="idtRealCardParserRoute">
<from ref="fileParserInputEndPoint"/>
<transacted ref="idtTxRequired"/>
<split>
<method bean="realCardParser" method="handle"/>
<to uri="bean:realCardFinalizer"/>
</split>
<to ref="fileParserOutputEndPoint"/>
</route>
</routeContext>
ラクダに例外を無視させる方法は?スプリッターをtry/catchブロックで囲んでみましたが、役に立ちませんでした。