Announcement Announcement Module
Collapse
No announcement yet.
FTP outbound gateway LS not "working" on unix machines Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • FTP outbound gateway LS not "working" on unix machines

    I have a simple ftp outbound gateway configured for ls, get, rm

    Code:
            <int-ftp:outbound-gateway id="gatewayLS" 
    		cache-sessions="false" 
    		session-factory="incomingCachingSessionFactory"
    		request-channel="inboundChannel" 
    		command="ls" 
    		command-options="-1" 
    		expression="'${ftp.pull.remote.directory}'"
    		reply-channel="toSplitter" />
    
    	<channel id="toSplitter">
    		<interceptors>
    			<wire-tap channel="logger" />
    		</interceptors>
    	</channel>
    
    	<logging-channel-adapter id="logger"
    		log-full-message="true" level="DEBUG" />
    
    	<splitter id="splitter" input-channel="toSplitter"
    		output-channel="toGet" />
    
    	<int-ftp:outbound-gateway id="gatewayGET"
    		cache-sessions="false"
    		local-directory="${ftp.pull.local.directory}"
    		session-factory="incomingCachingSessionFactory" 
    		request-channel="toGet"
    		reply-channel="downloadedFileChannel" 
    		command="get" 
    		command-options="-P"
    		expression="headers['file_remoteDirectory'] + '/' + payload" />
    this works perfectly on my development windows box, connecting to multiple different FTP servers.

    and my log outputs expected
    Code:
    DEBUG: org.springframework.integration.ftp.session.DefaultFtpSessionFactory - Connected to server [ftp.domain.com:21]
    DEBUG: org.springframework.integration.ftp.gateway.FtpOutboundGateway - handler 'org.springframework.integration.ftp.gateway.FtpOutboundGateway#0' sending reply Message: [Payload=[test_file.zip]][Headers={timestamp=1343143242030, id=56758ef9-57e5-43d6-b8b7-c36539d9fd0d, file_remoteDirectory=/images/}]
    the time bewteen the "Connected to server" and "sending reply Message" is also pretty much instantaneous

    however, once deployed to 2x Centos servers (5.8 and 6.2), the reply channel of the LS is always emtpy
    e.g.
    Code:
    DEBUG: org.springframework.integration.ftp.session.DefaultFtpSessionFactory - Connected to server [ftp.domain.com:21]
    DEBUG: org.springframework.integration.ftp.gateway.FtpOutboundGateway - handler 'org.springframework.integration.ftp.gateway.FtpOutboundGateway#0' sending reply Message: [Payload=[]][Headers={timestamp=1343143961046, id=31759d6f-201e-4028-8943-0a68ae64db81, file_remoteDirectory=/images/}]
    the time between the "Connected to server" and "sending reply Message" is also abnormally long.


    some more info:
    • all 3 machines are using maven to build the WAR from the same code base.
    • the 2 centos machines are in different datacentres
    • I have tried multiple different unrelated FTP servers, with the same results
    • there are definately files on the ftp server
    • the ftp servers are accessable on the centos boxes, confirmed using "ncftp" and "ftp"


    I know this post is pretty vague, but it is driving me nuts. any thoughts greatly appreciated

    thanks
    Shaine
    Last edited by shaine; Jul 24th, 2012, 03:41 PM.

  • #2
    I use Linux exclusively and have had no problems.

    Here are few things to look at...

    Are the destination servers Windows? If so, are you setting the remote file separator properly?

    Long connection times may point to DNS and/or other network issues.

    If there are firewalls involved, you might want to explore using passive mode.

    If all else fails, run a wire shark network trace to see what's going on.

    Comment


    • #3
      I hadnt actually set my client mode to passive, when I thought I had

      Comment

      Working...
      X