假设我的 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 类中的远程目录?
我尝试使用 context.getBean('sftpOutbound')
但它返回 EventDrivenConsumer 类,该类没有获取配置的方法。
我正在使用 spring-integration-sftp v 4.0.0。
最佳答案
我实际上更关心你为什么想要访问它。我的意思是远程目录和其他属性将随每条消息的 header 一起提供,因此您可以在消息级别访问它,但不能在事件驱动消费者级别访问它,这是设计使然,因此我的问题。 p>
关于java - Spring Integration SFTP - 从 XML 获取配置,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48399059/