【问题标题】:Spring Integration communication between contexts上下文之间的 Spring Integration 通信
【发布时间】:2016-08-24 11:54:20
【问题描述】:

我想修复以下场景:

1:N Spring 上下文(父/子)

  • 父上下文包含一个 JMS inputChannel,它将接收一个 字符串消息。
  • 每个子上下文都包含一个 TCP 适配器(发送方和接收方) 连接到不同的 IP:PORT

我的问题是如何将父上下文中定义的@Gateway 与对应的子级连接起来。我可以通过有效负载使用@Router,甚至可以使用带有标题的@Filter,但我的问题是关于不同上下文之间的@Component 可见性。如何配置此方案?

此时,我有:

Gateway (parent) -> Transformer (parent) -> TCP sender (Child)

【问题讨论】:

    标签: spring spring-boot spring-integration


    【解决方案1】:

    现在它正在工作,包括一个@Transformer,其中输入/输出通道来自两个上下文。在我的例子中:

    @Transformer(inputChannel="inputChannel", outputChannel="toTcpChannel")
    
    @Transformer(inputChannel="fromTcpChannel", outputChannel="outputChannel")
    
    • toTcpChannelfromTcpChannel 来自子上下文
    • inputChanneloutputChannel 来自父上下文

    【讨论】:

      猜你喜欢
      • 2015-12-01
      • 1970-01-01
      • 1970-01-01
      • 2018-06-24
      • 2018-01-22
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2018-10-07
      相关资源
      最近更新 更多