2
votes

I have a scenario in which I need to send a text file from a host machine to multiple remote machines through SFTP and spring integration. Please suggest approach to achieve this. I'm able to send single file to single host using outbound channel adapter. I have checked following links to create channel and session factory dynamically but I'm not able to create channel adapter programmatically please suggest https://github.com/spring-projects/spring-integration-samples/blob/a93ee7fb35913de603dcca9970fea28bcfe956cf/advanced/dynamic-ftp/src/test/java/org/springframework/integration/samples/ftp/DynamicFtpChannelResolverTests.java#L9

https://github.com/spring-projects/spring-integration-samples/blob/master/advanced/dynamic-ftp/src/main/java/org/springframework/integration/samples/ftp/DynamicFtpChannelResolver.java

1

1 Answers

1
votes

Comes to mind the solution with <publish-subscribe-channel> and several <int-sftp:outbound-channel-adapter> for each remove host.

You eve can configure the <publish-subscribe-channel> with executor to send to each subscriber concurrently.

And you will have an ability to continue to send only the message to the channel.