首页 文章

Spring Integration SFTP - 从XML获取配置

提问于
浏览
1

假设我的xml中有这些配置,

<int-sftp:outbound-channel-adapter  id="sftpOutbound"
            channel="sftpChannel"
            auto-create-directory="true"
            remote-directory="/path/to/remote/directory/"
            session-factory="cachingSessionFactory">
    <int-sftp:request-handler-advice-chain>
        <int:retry-advice />
    </int-sftp:request-handler-advice-chain>
</int-sftp:outbound-channel-adapter>

如何检索Java类中的属性,即remote-directory?

我尝试使用 context.getBean('sftpOutbound') ,但它返回没有获取配置方法的EventDrivenConsumer类 .

我正在使用spring-integration-sftp v 4.0.0 .

1 回答

  • 1

    我实际上更关心你为什么要访问它 . 我的意思是远程目录和其他属性将随每条消息的 Headers 一起提供,因此您可以在消息级别访问它,但不能在事件驱动的消费者级别访问它,这是设计的,因此我的问题 .

相关问题