I have implemented SFTP upload to a remote server using the example here.
My requirement is that I will have to upload the same file to multiple directories on the same server. The exact number or location of the directories will be known post-production.
Currently, my implementation allows for upload to a single directory on a single server, by setting remoteDirectoryExpression
on the message handler. The remoteDirectoryExpression
comes from a property file. It is expected that the remaining directories will be configured in a comma-separated way on the same property. I would like my implementation to extract each of the these comma-separated directories from the property and upload the file to each of them.
Is this even possible? I came across publish-subscribe channels but am currently struggling to understand how to include them in my implementation. Even then, pub-sub channels seem to require pre-configuring in the code where one channel = one directory. So am I even on the right track?