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