Announcement Announcement Module
Collapse
No announcement yet.
ftp:inbound-channel-adapter stops downloading files after a while Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • ftp:inbound-channel-adapter stops downloading files after a while

    Hello all,

    I am facing some trouble on a Web Application. I have the following configuration (I have omitted non relative stuff)

    Code:
    <int:channel id="ftpChannel">
      <int:queue />
    </int:channel>
    
    <bean id="ftpClientFactory" class="org.springframework.integration.ftp.session .DefaultFtpSessionFactory">
      <property name="host" value="${host}"/>
      <property name="port" value="${port}"/>
      <property name="username" value="${username}"/>
      <property name="password" value="${password}"/>
      <property name="clientMode" value="0"/>
      <property name="fileType" value="2"/>
      <property name="bufferSize" value="100000"/>
    </bean>
    
    <int-ftp:inbound-channel-adapter id="ftpInbound" 
       channel="ftpChannel"
       session-factory="ftpClientFactory"
       charset="UTF-8"
       auto-create-local-directory="true"
       delete-remote-files="true"
       filename-pattern="*.txt"
       remote-directory="/the/remote/directory/"
       remote-file-separator="/"
       local-directory="/the/local/directory/">
    <int:poller fixed-rate="1000" max-messages-per-poll="-1"/>
    </int-ftp:inbound-channel-adapter>


    The Web Application in deployed on a tomcat 6.0.20.0, which lives on a fedora 12 linux machine (production server). Everything works ok. The issue is that after some time (every 4 or 5 days) it stops working. The Web Application works perfectly ok, but the pulling of files stops. Files are created at the remote directory but are not pulled to the local one. There are no exceptions thrown that would make me trace the problem. It just stops pulling files. When I restart tomcat, pending files are consumed, and everything seems to start woking again. I don't want to jump into the conclusion that the channel gets stuffed or something similar, but it seems so.

    Any ideas on how to track and resolve the issue?

    thanx
    /axel

  • #2
    This is typically caused by the FTP server hanging (the client is waiting for data).

    You can use jstack (or VisualVM) to get a stack trace to confirm that.

    This thread shows how to override the DefatulFtpSessionFactory enabling you to set timeouts on the ftp activity...

    http://forum.springsource.org/showth...tBeforeConnect

    Comment


    • #3
      Hello Gary

      thanx for the reply. I am sorry I did not reply sooner myself, but I've been away.

      In any case, I've over-ridden the ftp session factory and set the timeout. Unfortunately, I cannot immediately say if it works or not, since the issue is not reproducible at once but takes some time. I'll keep monitoring, but for now we can consider the issue fixed.

      Thanx again for the help
      /axel

      Comment

      Working...
      X