Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/310.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java 来自windows server spring集成的Sftp_Java_Spring_Spring Integration_Sftp_Spring Integration Sftp - Fatal编程技术网

Java 来自windows server spring集成的Sftp

Java 来自windows server spring集成的Sftp,java,spring,spring-integration,sftp,spring-integration-sftp,Java,Spring,Spring Integration,Sftp,Spring Integration Sftp,我需要sftp将不同的文件放到服务器上 在传递范围内的文件驻留在Windows服务器中 为此,我考虑使用Spring Integration适配器,因为我不仅需要交付文件,而且还需要为每次文件交付将元数据信息写入数据库 您知道如何使用spring integration将windows上的多个文件共享给其他服务器吗?标准的FileReadingMessageSource确实要求功能: 在那里,您可以使用共享的Windows目录提取文件,然后将消息发送到SftpMessageHandler: 但由

我需要sftp将不同的文件放到服务器上

在传递范围内的文件驻留在Windows服务器中

为此,我考虑使用Spring Integration适配器,因为我不仅需要交付文件,而且还需要为每次文件交付将元数据信息写入数据库


您知道如何使用spring integration将windows上的多个文件共享给其他服务器吗?

标准的
FileReadingMessageSource
确实要求功能:

在那里,您可以使用共享的Windows目录提取文件,然后将消息发送到
SftpMessageHandler


但由于我们在Spring集成中处理消息通道,因此将消息发送到其他地方(如JDBC)非常容易。

谢谢Artem。您能告诉我如何为
FileReadingMessageSource
拾取的、由
SftpMessageHandler
处理的每个文件传输连接JDBC元数据编写类吗?您可以使用PublishSubscribeChannel执行该任务。并将SFTP和JDBC通道适配器作为它的订户。当然,您可以在提到的文档中找到这些信息。您还可以在示例repo:Hi中学习更多Spring集成,使用FileReadingMessageSource,假设我的应用程序托管在主机A上,并且可以访问网络路径主机B,它可以从主机B读取文件吗?或者文件必须在主机上,它也可以从网络或安装的设备上读取。换句话说:只要
FileReadingMessageSource
对您有用,就可以处理
File
对象。