再会,
我正在使用 spring integration 2.2 将侦听器构建到一个文件夹。我可以知道如何在文件传输中途检查我的听众是否会拾取文件?还是会等到完整的文件传输完毕?
假设有一个 10MB 的 txt 文件,但由于互联网速度慢,文件需要 10 秒才能传输到文件夹。假设在第 5 秒,文件只传输了 5MB,还有 5MB 走,听者可能去拾取文件并处理?
这是我在 xml 中的侦听器代码的一部分:
<int-file:inbound-channel-adapter id="hostFilesIn" directory="${hostfile.dir.in}"
prevent-duplicates="true" filename-regex="${hostfile.in.filename-regex}">
<int:poller id="poller" fixed-rate="${poller.fixrate:15000}" max-messages-per-poll="1" />
</int-file:inbound-channel-adapter>
如果需要更多信息,请告诉我。
这是发生的问题:
从日志中,我们可以看到一个文件被添加到队列中,
2019-02-01 11:13:33.011 [task-scheduler-9] DEBUG org.springframework.integration.file.FileReadingMessageSource - Added to queue: [/apps/NAS/ftp/in/incompleteL041.TXT]
之后遇到以下错误:
2019-02-01 11:13:33.096 [task-scheduler-9] DEBUG c.c.c.c.g.a.auditservice.SimpleErrorIdResolver - ERROR MESSAGE7 :
java.io.FileNotFoundException: /apps/NAS/ftp/in/incompleteL041.TXT (A file or directory in the path name does not exist.)
这是因为,当文件传输完成后,它会将其重命名为 L041.TXT。
好心提醒。