Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/318.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Spring integration 当我们使用spring入站通道适配器持续轮询sftp服务器时,它会挂断吗_Spring Integration - Fatal编程技术网

Spring integration 当我们使用spring入站通道适配器持续轮询sftp服务器时,它会挂断吗

Spring integration 当我们使用spring入站通道适配器持续轮询sftp服务器时,它会挂断吗,spring-integration,Spring Integration,我正在使用SpringIntegrationPoller从sftp服务器下载文件 <int-sftp:inbound-channel-adapter channel="myFileDownloadChannel" session-factory="mySftpSessionFactory" remote-directory="#{remot

我正在使用SpringIntegrationPoller从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台服务器上运行此代码

  • 如果6台服务器每10分钟轮询一次,是否会挂断sftp服务器
  • 它是否在每次触发轮询器时建立新连接
  • 请给我一些建议

  • 这取决于服务器,但可能没什么大不了的;对我来说听起来不是很高的音量
  • 您可以将会话工厂包装在一个
    CachingSessionFactory
    中,以保持会话打开,但许多服务器都配置为丢弃空闲连接

  • 中添加一个布尔变量
    “cache sessions=false”
    我发现我们需要指定“cache sessions=false”设置,设置为false(默认为TRUE)将导致每次使用时关闭会话。这行吗?为什么?一点基本原理对未来的访客很有帮助。