0

几年来,我一直在使用 Spring-Integration 4.1.6 连接到旧的 FTP 服务器。FTP 服务器最近被更新的版本(新服务器是 Globalscape EFT Enterprise)替换,我的 int-ftp 入站通道适配器立即停止查找文件。我监视了几个帐户,它们都同时停止工作。

下面是其中一个的配置:

<beans:bean id="ftpSessionFactory" class="org.springframework.integration.ftp.session.DefaultFtpSessionFactory">
    <beans:property name="host" value="${ftp.host}" />
    <beans:property name="port" value="${ftp.port}" />
    <beans:property name="username" value="${ftp.username}" />
    <beans:property name="password" value="${ftp.password}" />
    <beans:property name="clientMode" value="2" />
    <beans:property name="fileType" value="2" />
    <beans:property name="bufferSize" value="5000000" />
</beans:bean>

<beans:bean id="cachingSessionFactory" class="org.springframework.integration.file.remote.session.CachingSessionFactory">
    <beans:constructor-arg ref="ftpSessionFactory" />
    <beans:constructor-arg value="1" />
    <beans:property name="sessionWaitTimeout" value="60000" />
</beans:bean>

<int-ftp:inbound-channel-adapter id="ftpInboundChannelAdapter" channel="ftpChannelIn" session-factory="cachingSessionFactory" auto-create-local-directory="true"
        delete-remote-files="true" remote-directory="dev" local-directory="C:/temp" auto-startup="true">
    <poller max-messages-per-poll="-1" receive-timeout="10000" cron="0 0/2 * * * *" >
        <transactional/>
    </poller>
</int-ftp:inbound-channel-adapter>

当我调试适配器时,我看到了这个语句:

[org.springframework.integration.ftp.inbound.FtpInboundFileSynchronizer] cannot copy, not a file: dev/dev

但是 dev 下面没有名为 dev 的文件夹,只有一个 .csv 文件。

结构是 /path/to/user/dev/file.csv 并且 FTP 服务器配置为在用户执行 PWD 时向用户显示整个路径。

而且我确信当登录发生时,它们被放置在 /path/to/user 文件夹中。

我在本地环境中建立了另一个 FTP 服务器,它运行良好。

某些非标准 FTP 服务器是否存在导致此类问题的问题?

先感谢您

4

1 回答 1

0

事实证明,最新版本的 GlobalScape EFT (8.0.2.x) 错误地实现了 LIST 命令。当执行 LIST some/directory 进行监视时,它们返回的是目录本身的详细信息,而不是目录的内容。这是他们 7.x 版本的行为变化。

如果我可以配置 Spring Integration FTP 库执行 CWD 然后列出当前文件夹,那就太好了。或者让它使用 NLST。但是,由于这只是 FTP 服务器上的一个错误,因此完全可以理解为什么这不是一个选项。

于 2020-09-25T13:45:14.167 回答