此版本仍在开发中,尚未被视为稳定版本。对于最新的稳定版本,请使用 Spring Integration 6.3.1Spring中文文档

此版本仍在开发中,尚未被视为稳定版本。对于最新的稳定版本,请使用 Spring Integration 6.3.1Spring中文文档

Spring Integration 支持通过 SFTP 进行文件传输操作。Spring中文文档

安全文件传输协议 (SFTP) 是一种网络协议,可让您通过任何可靠的流在 Internet 上的两台计算机之间传输文件。Spring中文文档

SFTP 协议需要安全通道(如 SSH)以及在整个 SFTP 会话中对客户端身份的可见性。Spring中文文档

Spring Integration 通过提供三个客户端端点来支持通过 SFTP 发送和接收文件:入站通道适配器、出站通道适配器和出站网关。 它还提供方便的命名空间配置来定义这些客户端组件。Spring中文文档

从版本 6.0 开始,过时的 JCraft JSch 客户端已被现代 Apache MINA SSHD 框架取代。 这导致了框架组件中的许多重大更改。 但是,在大多数情况下,此类迁移隐藏在Spring Integration API后面。 最剧烈的变化发生在一个,它现在基于并公开了一些它的配置属性。DefaultSftpSessionFactoryorg.apache.sshd.client.SshClient
从版本 6.0 开始,过时的 JCraft JSch 客户端已被现代 Apache MINA SSHD 框架取代。 这导致了框架组件中的许多重大更改。 但是,在大多数情况下,此类迁移隐藏在Spring Integration API后面。 最剧烈的变化发生在一个,它现在基于并公开了一些它的配置属性。DefaultSftpSessionFactoryorg.apache.sshd.client.SshClient

您需要将此依赖项包含在项目中:Spring中文文档

<dependency>
    <groupId>org.springframework.integration</groupId>
    <artifactId>spring-integration-sftp</artifactId>
    <version>6.2.7-SNAPSHOT</version>
</dependency>
compile "org.springframework.integration:spring-integration-sftp:6.2.7-SNAPSHOT"

若要在 xml 配置中包含 SFTP 命名空间,请在根元素上包含以下属性:Spring中文文档

xmlns:int-sftp="http://www.springframework.org/schema/integration/sftp"
xsi:schemaLocation="http://www.springframework.org/schema/integration/sftp
    https://www.springframework.org/schema/integration/sftp/spring-integration-sftp.xsd"