Spring Integration FTP – InboundChannelAdapter在与新的FTP服务器通信时停止工作

huangapple go评论96阅读模式
英文:

Spring Integration FTP - InboundChannelAdapter Stopped working with new FTP server

问题

我一直在使用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] 无法复制,不是文件:dev/dev

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

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

我确信登录时,他们被放置在/path/to/user文件夹中。

我在本地环境上搭建了另一个FTP服务器,它正常工作。

是否有某些非标准FTP服务器引起类似这样的问题?

提前感谢您的回答。

英文:

I've been using Spring-Integration 4.1.6 to connect to an old FTP server for several years now. The FTP server was recently replaced with a newer version (the new server is Globalscape EFT Enterprise) and immediately my int-ftp inbound-channel-adapters stopped finding files. I monitor several accounts and they all stopped working at the same time.

Here is the configuration of one:

&lt;beans:bean id=&quot;ftpSessionFactory&quot; class=&quot;org.springframework.integration.ftp.session.DefaultFtpSessionFactory&quot;&gt;
    &lt;beans:property name=&quot;host&quot; value=&quot;${ftp.host}&quot; /&gt;
    &lt;beans:property name=&quot;port&quot; value=&quot;${ftp.port}&quot; /&gt;
    &lt;beans:property name=&quot;username&quot; value=&quot;${ftp.username}&quot; /&gt;
    &lt;beans:property name=&quot;password&quot; value=&quot;${ftp.password}&quot; /&gt;
    &lt;beans:property name=&quot;clientMode&quot; value=&quot;2&quot; /&gt;
    &lt;beans:property name=&quot;fileType&quot; value=&quot;2&quot; /&gt;
    &lt;beans:property name=&quot;bufferSize&quot; value=&quot;5000000&quot; /&gt;
&lt;/beans:bean&gt;

&lt;beans:bean id=&quot;cachingSessionFactory&quot; class=&quot;org.springframework.integration.file.remote.session.CachingSessionFactory&quot;&gt;
    &lt;beans:constructor-arg ref=&quot;ftpSessionFactory&quot; /&gt;
    &lt;beans:constructor-arg value=&quot;1&quot; /&gt;
    &lt;beans:property name=&quot;sessionWaitTimeout&quot; value=&quot;60000&quot; /&gt;
&lt;/beans:bean&gt;

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

and when I debug the adapter, I see this statement:

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

But there is no folder named dev underneath dev, only a single .csv file.

The structure is /path/to/user/dev/file.csv and the FTP server is configured to show the entire path to the user when they do a PWD.

And I am sure that when the login happens, they are placed in the /path/to/user folder.

I stood up another FTP server on my local environment, and it worked fine.

Have there been problems with certain non-standard FTP servers causing issues like this?

Thank you in advance

答案1

得分: 0

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

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

英文:

It turns out, the latest version of GlobalScape EFT (8.0.2.x) has incorrectly implemented the LIST command. When a LIST some/directory is performed for monitoring, they were returning the details of the directory itself and not the contents of the directory. This was a change in behavior from their 7.x version.

It would have been nice if I could have configured the Spring Integration FTP library do a CWD and then LIST of the current folder. Or have it use NLST. However, as this was just a bug on a FTP server, it is completely understandable why that is not an option.

huangapple
  • 本文由 发表于 2020年9月23日 04:29:52
  • 转载请务必保留本文链接:https://go.coder-hub.com/64017250.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定