0

リモート SFTP サーバーからいくつかのファイルを取得するために使用しcamel-sftpていますが、それらを取得した後、それらを削除したいと考えています。Windows ファイルでルートを実行すると、ファイルが削除され、すべてが期待どおりに機能します。ただし、CentOS で実行すると、ファイルは取得されますが削除されず、リモート サーバーに蓄積され始めます。

Camel 2.13.1 と Java 7 を使用しています。私のコンシューマー URI は次のようになります。

sftp://remoteUser@remoteHost?privateKeyFile=locationOfMyPrivateKey.key&binary=true&disconnect=true&delay=20s&delete=true&idempotent=false&include=.*.txt&useFixedDelay=false&maxMessagesPerPoll=10&eagerMaxMessagesPerPoll=false&sortBy=reverse:file:name

また、Camel 2.13.2 および 2.13.3 の未解決の問題と解決済みの問題を調べたところ、次のチケットが見つかりました: https://issues.apache.org/jira/browse/CAMEL-7565これは正確にはわかりません私のシナリオで起こっています。もう 1 つの可能性は、問題が基盤となるライブラリ JSCH に起因しているがcamel-ftp、ほぼ最新バージョンを使用しており、最新バージョンの変更ログにはこれについて何も言及されていないことです。

最後にsftp、CentOS でコマンドを使用し、リモートで SFTP サーバーに接続すると、ファイルを削除しても問題はありません。これにより、キーに問題がある可能性があるという考えが取り除かれます。

何か案は?

UPDATE これはログです。delete=trueオプションを設定しても理解していないようです。ログには「ファイルを削除しています」とは書かれていません。これは、スレッドが の 382 行目のコードにアクセスしていないためだと思いますSftpOperations.java。何が起こっているのかわからない...

2014-12-15 20:36:28,431 TRACE [Camel (mySFTPRoute) thread #0 - sftp://remoteUser@remoteHost] - GenericFileConsumer.processExchange (GenericFileConsumer.java:356) - Retrieving file: data/file1.txt from: Endpoint[sftp://remoteUser@remoteHost/data?binary=true&delay=20s&delete=true&disconnect=true&eagerMaxMessagesPerPoll=false&idempotent=false&include=.*.txt&maxMessagesPerPoll=10&passiveMode=true&privateKeyFile=locationOfMyPrivateKey.key&reconnectDelay=30000&soTimeout=50000&sortBy=file%3Aname&useFixedDelay=false]
2014-12-15 20:36:28,431 TRACE [Camel (mySFTPRoute) thread #0 - sftp://remoteUser@remoteHost] - SftpOperations.retrieveFile (SftpOperations.java:588) - retrieveFile(data/file1.txt)
2014-12-15 20:36:28,431 TRACE [Camel (mySFTPRoute) thread #0 - sftp://remoteUser@remoteHost] - SftpOperations.getCurrentDirectory (SftpOperations.java:472) - getCurrentDirectory()
2014-12-15 20:36:28,431 TRACE [Camel (mySFTPRoute) thread #0 - sftp://remoteUser@remoteHost] - SftpOperations.getCurrentDirectory (SftpOperations.java:475) - Current dir: /
2014-12-15 20:36:28,431 TRACE [Camel (mySFTPRoute) thread #0 - sftp://remoteUser@remoteHost] - SftpOperations.changeCurrentDirectory (SftpOperations.java:483) - changeCurrentDirectory(data)
2014-12-15 20:36:28,431 TRACE [Camel (mySFTPRoute) thread #0 - sftp://remoteUser@remoteHost] - SftpOperations.changeCurrentDirectory (SftpOperations.java:494) - Compacted path: data -> data using separator: /
2014-12-15 20:36:28,432 TRACE [Camel (mySFTPRoute) thread #0 - sftp://remoteUser@remoteHost] - SftpOperations.getCurrentDirectory (SftpOperations.java:472) - getCurrentDirectory()
2014-12-15 20:36:28,432 TRACE [Camel (mySFTPRoute) thread #0 - sftp://remoteUser@remoteHost] - SftpOperations.getCurrentDirectory (SftpOperations.java:475) - Current dir: /
2014-12-15 20:36:28,432 TRACE [Camel (mySFTPRoute) thread #0 - sftp://remoteUser@remoteHost] - SftpOperations.doChangeDirectory (SftpOperations.java:538) - Changing directory: data
2014-12-15 20:36:28,851 TRACE [Camel (mySFTPRoute) thread #0 - sftp://remoteUser@remoteHost] - IOHelper.copy (IOHelper.java:191) - Copying InputStream: com.jcraft.jsch.ChannelSftp$2@308a9271 -> OutputStream:  with buffer: 4096 and flush on each write false
2014-12-15 20:36:29,604 TRACE [Camel (mySFTPRoute) thread #0 - sftp://remoteUser@remoteHost] - SftpOperations.changeCurrentDirectory (SftpOperations.java:483) - changeCurrentDirectory(/)
2014-12-15 20:36:29,604 TRACE [Camel (mySFTPRoute) thread #0 - sftp://remoteUser@remoteHost] - SftpOperations.changeCurrentDirectory (SftpOperations.java:494) - Compacted path: / -> / using separator: /
2014-12-15 20:36:29,605 TRACE [Camel (mySFTPRoute) thread #0 - sftp://remoteUser@remoteHost] - SftpOperations.getCurrentDirectory (SftpOperations.java:472) - getCurrentDirectory()
2014-12-15 20:36:29,605 TRACE [Camel (mySFTPRoute) thread #0 - sftp://remoteUser@remoteHost] - SftpOperations.getCurrentDirectory (SftpOperations.java:475) - Current dir: /data
2014-12-15 20:36:29,605 TRACE [Camel (mySFTPRoute) thread #0 - sftp://remoteUser@remoteHost] - SftpOperations.getCurrentDirectory (SftpOperations.java:472) - getCurrentDirectory()
2014-12-15 20:36:29,605 TRACE [Camel (mySFTPRoute) thread #0 - sftp://remoteUser@remoteHost] - SftpOperations.getCurrentDirectory (SftpOperations.java:475) - Current dir: /data
2014-12-15 20:36:29,605 TRACE [Camel (mySFTPRoute) thread #0 - sftp://remoteUser@remoteHost] - SftpOperations.doChangeDirectory (SftpOperations.java:538) - Changing directory: ..
2014-12-15 20:36:29,816 TRACE [Camel (mySFTPRoute) thread #0 - sftp://remoteUser@remoteHost] - GenericFileConsumer.processExchange (GenericFileConsumer.java:386) - Retrieved file: data/file1.txt from: Endpoint[sftp://remoteUser@remoteHost/data?binary=true&delay=20s&delete=true&disconnect=true&eagerMaxMessagesPerPoll=false&idempotent=false&include=.*.txt&maxMessagesPerPoll=10&passiveMode=true&privateKeyFile=locationOfMyPrivateKey.key&reconnectDelay=30000&soTimeout=50000&sortBy=file%3Aname&useFixedDelay=false]
2014-12-15 20:36:29,817 DEBUG [Camel (mySFTPRoute) thread #0 - sftp://remoteUser@remoteHost] - GenericFileConsumer.processExchange (GenericFileConsumer.java:396) - About to process file: RemoteFile[file1.txt] using exchange: Exchange[file1.txt]
2014-12-15 20:36:29,817 TRACE [Camel (mySFTPRoute) thread #0 - sftp://remoteUser@remoteHost] - DefaultUnitOfWork.<init> (DefaultUnitOfWork.java:77) - UnitOfWork created for ExchangeId: ID-my-machine-name-37091-1418675752051-0-23 with Exchange[file1.txt]
2014-12-15 20:36:29,817 TRACE [Camel (mySFTPRoute) thread #0 - sftp://remoteUser@remoteHost] - EventHelper.doNotifyEvent (EventHelper.java:766) - Notitxtation of event is disabled: ID-my-machine-name-37091-1418675752051-0-23 exchange created: Exchange[file1.txt]
2014-12-15 20:36:29,935 TRACE [Camel (mySFTPRoute) thread #0 - sftp://remoteUser@remoteHost] - GenericFileConsumer$1.done (GenericFileConsumer.java:405) - Done processing file: RemoteFile[file1.txt] synchronously
2014-12-15 20:36:29,935 TRACE [Camel (mySFTPRoute) thread #0 - sftp://remoteUser@remoteHost] - GenericFileConsumer.processExchange (GenericFileConsumer.java:316) - Processing file: RemoteFile[file2.txt]
2014-12-15 20:36:29,937 TRACE [Camel (mySFTPRoute) thread #0 - sftp://remoteUser@remoteHost] - GenericFileConsumer.processExchange (GenericFileConsumer.java:356) - Retrieving file: data/file2.txt from: Endpoint[sftp://remoteUser@remoteHost/data?binary=true&delay=20s&delete=true&disconnect=true&eagerMaxMessagesPerPoll=false&idempotent=false&include=.*.txt&maxMessagesPerPoll=10&passiveMode=true&privateKeyFile=locationOfMyPrivateKey.key&reconnectDelay=30000&soTimeout=50000&sortBy=file%3Aname&useFixedDelay=false]
4

0 に答える 0