很好的一天,
我使用SpringIntegration2.2将侦听器构建到一个文件夹。我能知道当文件传输到一半时,我如何检查我的侦听器是否会接收文件吗?或者要等到完整的文件传输完毕?
假设有一个10MB的txt文件,但是由于internet速度慢,该文件需要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。
请告知。