Thank you for the quick reply! My sftp XSD (using 2.0.3.RELEASE?) doesn't seem to have an order attribute defined, and only setting order="2" on the service-activator didn't seem to have the desired effect.
However I could implement the same idea with two channels and a wire-tap like so:
Code:
<integration:channel id="outboundFiles">
<integration:interceptors>
<integration:wire-tap channel="outboundFilesToSftp"/>
</integration:interceptors>
</integration:channel>
<integration:channel id="outboundFilesToSftp"/>
<sftp:outbound-channel-adapter id="sftpOutboundAdapter"
session-factory="sftpSessionFactory"
channel="outboundFilesToSftp"
charset="UTF-8"
remote-directory="output-dir"/>
<integration:service-activator id="cleanupAfterUpload"
input-channel="outboundFiles"
expression="payload.delete()"
output-channel="nullChannel"/>
The wire-tap copies the message in preSend, therefore the "tap" channel will receive its copy first - that must be our outbound channel adapter.
Thanks again!