<file:outbound-channel-adapter id="processingDirOutputAdapter"
directory=""
delete-source-files="false"
channel="dataFileMoveToArchiveDir"
>
</file:outbound-channel-adapter>
<int-file:inbound-channel-adapter id="inErrorINPRm"
channel="errorRm"
directory="in/error"
>`enter code here`
<int:poller fixed-rate="5000" />
</int-file:inbound-channel-adapter>
<int:channel id="errorRm"/>
<int:publish-subscribe-channel id="ErrorRmMv"/>
<int-ftp:outbound-channel-adapter id="ftpError"
channel="ErrorRmMv"
session-factory="ClientFactory"
auto-create-directory="true"
remote-directory="in/error"
>
</int-ftp:outbound-channel-adapter>
<int:service-activator id="cleanup"
input-channel="ErrorRmMv"
output-channel="nullChannel"
order="3"
expression="payload.delete('c:local/test/ + payload.name')"/>
Now after the outbound-channel i have to go back to source local folder to delete the local file in order to cleanup the folder
- file:outbound-channel-adapter will copy file from source local folder to local error folder (delete-remote-files="false")
- int-ftp:outbound-channel-adapter will move file to from local error folder to remote error folder
- service-activator should go to source local folder to delete the files completely after the int-ftp:outbound-channel-adapter move files to remote error folder