我正在使用spring integation poller从sftp服务器下载文件
<int-sftp:inbound-channel-adapter channel="myFileDownloadChannel"
session-factory="mySftpSessionFactory"
remote-directory="#{remote}"
filter = "modifiedFileListFilter"
local-directory="#{local}"
auto-create-local-directory="true">
<integration:poller cron="10 * * * * *" default="true"/>
</int-sftp:inbound-channel-adapter>
<integration:service-activator input-channel="myFileDownloadChannel"
ref="errorTransformer"
output-channel="endChannel"/>
我在6台服务器上运行此代码。
请建议。
答案 0 :(得分:0)
CachingSessionFactory
中以保持会话打开,但是许多服务器都配置为无论如何都要丢弃空闲连接。答案 1 :(得分:0)
将布尔变量"cache-sessions = false"
添加到<int-sftp:inbound-channel-adapter
默认情况下 TRUE 。并保留connections open.
将其设为 FALSE ,它将close sessions per use
。