英文:
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:
<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>
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.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论