Announcement Announcement Module
Collapse
No announcement yet.
FTP outbound-channel-adapter file rename Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • FTP outbound-channel-adapter file rename

    My target remote file is being moved to the home directory using ftp outbound-channel-adapter.
    Using an adapter like this:

    Code:
    <si-ftp:outbound-channel-adapter id="ftpOutbound"
    		channel="outChannel" session-factory="ftpSessionFactory" charset="UTF-8"
    		remote-directory="${ftpChannelRemoteWorkDestination}" />
    I see from the logs that at .writing file is appropriately created in the specified remote directory. Then a rename occurs that moves the file to the user's home directory on the FTP server without the .writing extension.

    I do like and need this rename feature in order to ensure files are complete before being touched, but I wonder why the remote directory is not used in the renamed file.

    I have found a work around for this by adding the following to the adapter:
    Code:
    remote-filename-generator-expression="'${ftpChannelRemoteWorkDestination}/'+payload.getName()"
    Is this a bug or intended behavior?

    Also, what is the best way to remove the local file after it has been successfully sent?
    I have not used channel interceptors before but would that work?
    It would be nice to have a "delete-local-files" attribute on the outbound adapter similar to the "delete-remote-files" on the inbound one.

    Just a thought, thanks for any help.

  • #2
    We discovered this bug yesterday and its already fixed
    https://jira.springframework.org/browse/INT-1704

    Can you possibly change your classpath to use nightly snapshots?
    Sorry about it

    Comment


    • #3
      Thanks for the quick reply. I will get the nightly snapshot.

      Any thoughts on deleting the local file once it has been successfully sent?
      Should I go down the channel interceptor road?

      Comment

      Working...
      X