私は現在、SI DSL SFTP機能を使っていくつかのファイルをプッシュしようとしています。Spring統合DSL SFTP良い習慣
私はこのfwkの使用に堪能ではありませんので、私が達成しようとしていることを実行するためのより良い方法があるのだろうかと思います。
それは一種のファイルがコピーされる場合を除き、次のように働いて、残りの呼び出しがタイムアウト状態に落ちる...
ボーナス:SI DSLについていくつかの良い測定値(オンラインブックまたは)はありますか? (カフェSIのサンプルとリファレンスを除く。)
編集:
- は、このSIフローは、SIグッドプラクティスに従っていますか?
- ファイルがsftpサーバーに正しくコピーされても、私の残りの呼び出しがタイムアウトで終了するのはなぜですか?
のJava設定:
@Configuration
@EnableIntegration
@IntegrationComponentScan
public class IntegrationConfig {
//flow gateway
@MessagingGateway
public interface FlowGateway {
@Gateway(requestChannel = "SftpFlow.input")
Collection<String> flow(Collection<File> name);
}
//sftp flow bean
@Bean
public IntegrationFlow SftpFlow() {
return f -> f
.split()
.handle(Sftp.outboundAdapter(this.sftpSessionFactory(), FileExistsMode.REPLACE)
.useTemporaryFileName(false)
.remoteDirectory(sftpFolder));
}
//sftp session config
@Bean
public DefaultSftpSessionFactory sftpSessionFactory() {
System.out.println("Create session");
DefaultSftpSessionFactory factory = new DefaultSftpSessionFactory(true);
factory.setHost(sftpHost);
factory.setPort(Integer.valueOf(sftpPort));
factory.setUser(sftpUser);
factory.setPassword(sftpPwd);
factory.setAllowUnknownKeys(true);
return factory;
}
}
RestControllerクラス:
@Autowired
private FlowGateway flowGateway;
@RequestMapping("/testSftp")
public String testSftp() {
flowGateway.flow(Arrays.asList(file1, file2, file3);
}
非常に明確な答えです。私が予想したとおりです。私はあなたの発言に従って私の質問を編集しました。 –