Results 1 to 4 of 4

Thread: FTP Outbound channel adapter - data send acknowledgment / error handling

  1. #1

    Default FTP Outbound channel adapter - data send acknowledgment / error handling

    Hello,
    I would like to ask you to follow up with one (similar) question http://forum.springsource.org/showth...r-interceptor&

    Since outbound-channel-adapter does not have reply-channel or error-handler - Is there already any official/recommended way how to check whether the files were successfully delivered into FTP server -> so we can do some operation or in case of some FTP error return code do error handling.

    My wished use case is:
    1. ls files from ftp1
    2. get files from ftp1
    3. send files one by one to ftp2 and delete corresponding temporary file (created in point 2.) in case of success. In case of error do not delete temporary file, do some error handling and continue with next file.

    This is the (working) piece of my code:
    Code:
    ...
    	<int-ftp:outbound-gateway id="ftpInboundLS"
    			session-factory="ftpIN"
    			request-channel="ftpInChannel"
    			reply-channel="toSplitter"
    			command="ls"
    			expression="'/foo/read/'"/>
    
    	<int:splitter id="splitter" input-channel="toSplitter" output-channel="toGet"/>
    	
    	<int-ftp:outbound-gateway id="ftpInboundGET"
    			local-directory="d:/foo"
    			session-factory="ftpIN"
    			request-channel="toGet"
    			reply-channel="ftpOutChannel"
    			command="get"
    			command-options="-P"
    			expression="payload.remoteDirectory + '/' + payload.filename"
    			auto-create-local-directory="true"/>
    
    	<int-ftp:outbound-channel-adapter id="ftpOutbound"
    			channel="ftpOutChannel" 
    			session-factory="ftpOUT"
    			remote-directory="/foo/write"/>
    	
    	<!-- Message here is sent through trigger-gateway which is not part of this sample-->
             <int:channel id="ftpInChannel">
    	</int:channel>
    
            <int:channel id="ftpOutChannel"> 
            </int:channel>
    ...
    </beans>

    Thank you,
    Jakub

  2. #2
    Join Date
    Jan 2009
    Location
    Ukraine, Kharkov
    Posts
    645

    Default

    Hello!

    At a glance you need request-handler-advice-chain: http://blog.springsource.org/2012/10...retry-and-more

    Cheers,
    Artem

  3. #3

    Default

    Thank you Cleric. I can figure oneself how the request-handler-advice-chain would be useful for me in this case but unfortunately I need to use SI 2.1 for now (since the whole code is connected with Spring-batch, Spring-batch-admin which, if I am right, is not prepared for SI 2.2).

    Thank you,
    Jakub

  4. #4
    Join Date
    Jan 2009
    Location
    Ukraine, Kharkov
    Posts
    645

    Default

    IT should work: Spring Batch doesn't depend on Spring Integration. From other side Spring Batch Admin has just few dependencies: http://static.springsource.org/sprin...endencies.html.
    Just try to switch to the latest SI quietly !

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •