使用基于密钥 Spring Cloud Stream SFTP 源私钥时 属性 未找到

When using Key Based Spring Cloud Stream SFTP Source Private Key Property not Found

我在本地 SCDF 服务器仪表板上使用以下定义创建了一个 SFTP 源 (sftp-source-kafka:2.1.0.M2):

sftp --local-dir=/tmp/inbox --filename-pattern=*.csv --task-launcher-output=true --remote-dir=/home/user/csv --private-key=file:/path/to/key/key-file.pem --username=user --host=***** --known-hosts-expression='"/path/to/hostfile/known_hosts"' | log

known_hosts文件和密钥文件都在SCDF服务器和accessibe上。当我启动流时,出现以下错误:

Caused by: java.lang.IllegalArgumentException: either a password or a private key is required
    at org.springframework.util.Assert.isTrue(Assert.java:118)
    at org.springframework.integration.sftp.session.DefaultSftpSessionFactory.getSession(DefaultSftpSessionFactory.java:352)
    at org.springframework.integration.sftp.session.DefaultSftpSessionFactory.getSession(DefaultSftpSessionFactory.java:57)
    at org.springframework.integration.file.remote.RemoteFileTemplate.execute(RemoteFileTemplate.java:438)

如果我在基于密码的 SFTP 服务器上尝试,流工作正常。我是否指定了错误的关键资源?我只尝试了前面没有 "file:" 的路径,这会导致同样的错误。

这是源应用程序中的错误;配置会话工厂时,我没有看到正在读取私钥 属性。

请打开一个GitHub Issue