2017-07-11 9 views
1

リモートディレクトリにローカルディレクトリのDocument.txtファイルを送信できましたが、リモートのファイルを削除すると同じファイルをFTPに送信できませんでしたローカルからもう一度送信しようとします.Pollerは、同じフォルダに別のファイルを置いた場合にピックアップするので、うまくいきます。これについていくつかの洞察を持てますか? <file:inbound-channel-adapter春の統合 - 同じ名前のファイルを2回目に送信することができません

enter code here 





    <!-- Inbound adapter channels for reading the local directory files in processed folder --> 
<file:inbound-channel-adapter id="inboundProcessed" 
           channel="processedChannel" 
           filename-pattern="*.txt" 
           directory="$dina-communication.batch-{localDirectory}" 
                   > 
    <int:poller fixed-rate="10000" /> 
</file:inbound-channel-adapter> 

<int:channel id="processedChannel"></int:channel> 

     <!-- Outbound adapter channels for FTP the files in processed folder to remote directory -->  
    <int-ftp:outbound-channel-adapter id="ftpProcessed" 
           channel="processedChannel" 
           session-factory="ftpClientFactory" 
           remote-directory="$dina-communication.batch-{remoteDirectory}" 
           > 

    <int-ftp:request-handler-advice-chain> 
    <bean class="org.springframework.integration.handler.advice.ExpressionEvaluatingRequestHandlerAdvice"> 
     <property name="onSuccessExpression" value="payload.delete()" /> 
     </bean> 
</int-ftp:request-handler-advice-chain>      

    </int-ftp:outbound-channel-adapter> 
+0

はSOへようこそ!次の内容を確認し、質問を更新してください: https://stackoverflow.com/help/how-to-ask – garfbradaz

答えて

0

は、パス名のために彼らのhashCodeすることで、受信ファイルを比較デフォルトでは、AcceptOnceFileListFilter使用しています:

/** 
* Computes a hash code for this abstract pathname. Because equality of 
* abstract pathnames is inherently system-dependent, so is the computation 
* of their hash codes. On UNIX systems, the hash code of an abstract 
* pathname is equal to the exclusive <em>or</em> of the hash code 
* of its pathname string and the decimal value 
* <code>1234321</code>. On Microsoft Windows systems, the hash 
* code is equal to the exclusive <em>or</em> of the hash code of 
* its pathname string converted to lower case and the decimal 
* value <code>1234321</code>. Locale is not taken into account on 
* lowercasing the pathname string. 
* 
* @return A hash code for this abstract pathname 
*/ 
public int hashCode() { 
    return fs.hashCode(this); 
} 

新しいファイルは、それが無視されているのと同じ名前が付いていますし、行くことができないのであなたの流れの下流。ファイルが更新された場合を比較するlastModifiedを使用して、あなたがFileSystemPersistentAcceptOnceFileListFilterを使用すべき問題が、克服するために

http://docs.spring.io/spring-integration/reference/html/files.html#file-reading

+0

確かに、私は試してみて、投稿してください! – DinaMike

+0

私は実際にアウトバウンド用に別のFTPクライアントファクトリを作成してみましたが、プロジェクトにFTPセッションがたくさんあるので、このアプローチを試みました。 – DinaMike

関連する問題