假设我在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。
发布于 2018-01-23 19:16:41
实际上,我更关心的是你为什么想要访问它。我的意思是,远程目录和其他属性将与每个消息的头部一起提供,因此您可以在消息级别访问它,但不能在事件驱动的消费者级别访问它,这是设计的结果,因此我提出了这个问题。
https://stackoverflow.com/questions/48399059
复制相似问题