0
votes

I am using spring integation poller to download files from an sftp server

<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"/>

I am running this code in 6 servers.

  1. Will it hung up the sftp server if the 6 servers are polling it every 10 min?.
  2. Does it make new connections each time the poller is triggered?.

Please advice.

2

2 Answers

0
votes
  1. It depends on the server, but it's probably not a big deal; doesn't sound like high volume to me.
  2. You can wrap the session factory in a CachingSessionFactory to keep the session open, but many servers are configured to drop idle connections anyway.
0
votes

Add a boolean variable "cache-sessions = false" to <int-sftp:inbound-channel-adapter

it's TRUE by default. and will keep the connections open.

set it as FALSE, it will close sessions per use.