Java 如何解决spring集成中ftp网关的连接超时问题?
谢谢关注 我在spring项目中使用了spring集成,我的项目是一个简单的文件处理,使用ftp适配器从ftp获取文件Java 如何解决spring集成中ftp网关的连接超时问题?,java,spring,spring-integration,spring-batch,ftp-client,Java,Spring,Spring Integration,Spring Batch,Ftp Client,谢谢关注 我在spring项目中使用了spring集成,我的项目是一个简单的文件处理,使用ftp适配器从ftp获取文件int ftp:outbound gateway,并运行批处理作业并将输出文件放在ftp上,我感觉当从服务器获取的文件大小或数量太大时,抛出连接超时异常,我的代码如下: <int:inbound-channel-adapter expression="'/'" channel="inbound"> <int:poller fixed-del
int ftp:outbound gateway
,并运行批处理作业并将输出文件放在ftp上,我感觉当从服务器获取的文件大小或数量太大时,抛出连接超时异常,我的代码如下:
<int:inbound-channel-adapter expression="'/'" channel="inbound">
<int:poller fixed-delay="${directory.server.polling.interval}"/>
</int:inbound-channel-adapter>
<int-ftp:outbound-gateway id="gatewayLS"
session-factory="ftpSessionFactory"
request-channel="inbound"
command="ls"
command-options="-R"
expression="payload"
reply-channel="inputFileSplitter"/>
<bean id="splitter" class="com.ali.integration.handler.splitter.Splitter"/>
<bean id="router" class="com.ali.integration.handler.router.Router"/>
<int:splitter input-channel="inputFileSplitter" ref="splitter" method="inputFileSplitter" output-channel="FilesChannel"/>
<int:channel id="FilesChannel"/>
<int:router input-channel="FilesChannel" ref="router" method="routInputFile"/>
<int-ftp:outbound-gateway id="gatewayGET"
local-directory-expression="@fileUtil.backupRootPath + #remoteDirectory"
session-factory="ftpSessionFactory"
request-channel="readyToGetFilesChannel"
reply-channel="readyFileToRemoveFromServerChannel"
command="get"
mode="REPLACE"
command-options="-P"
expression="payload.remoteDirectory + '/' + payload.filename"/>
在ftp服务器日志中:
.
10/18/2015 11:10:47 AM - test (127.0.0.1)> disconnected.
.
不幸的是,这是一个网络或服务器问题,框架对此无能为力 您可以尝试使用wireshark或类似工具跟踪网络流量
.
10/18/2015 11:10:47 AM - test (127.0.0.1)> disconnected.
.