0
votes
<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

  1. file:outbound-channel-adapter will copy file from source local folder to local error folder (delete-remote-files="false")
  2. int-ftp:outbound-channel-adapter will move file to from local error folder to remote error folder
  3. 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
1

1 Answers

1
votes

See the retry-and-more sample for how to apply an advice to the outbound adapter to take action after it has completed.

You don't seem to have applied the changes I suggested in my answer to your other question.

What you have won't work - you have two subscribers on ErrorRmMv - they will get alternate messages.