【问题标题】:Spring Integration - How can I have a workflow split off to two channels?Spring Integration - 如何将工作流拆分为两个通道?
【发布时间】:2019-03-06 13:42:29
【问题描述】:

大家早上好,我正在寻找一种方法将我们的工作流程分成两个不同的渠道。

          -> C1
 A -> B ->
          -> C2

作为一个整体,我对 Spring 还很陌生,只是一直在努力解决问题,无法通过 Google 找到解决方案。

我使用的工作流使用 int 文件读取源数据并将它们传递到 A - B 等各种渠道,但我需要能够将我的所有数据发送到两个唯一的渠道完全不同的东西。

为了让我将完整的数据发送到每个 C1/C2 通道,应该使用什么样的标签或主题?

【问题讨论】:

    标签: java spring spring-integration spring-batch configuration-files


    【解决方案1】:

    为此,您需要使用收件人列表路由器 EI 模式:https://www.enterpriseintegrationpatterns.com/patterns/messaging/RecipientList.html

    Spring Integration 对此有一个实现:https://docs.spring.io/spring-integration/docs/current/reference/html/#router-implementations-recipientlistrouter

    因此,您有一个 input-channel,并且您为要分发相同消息的每个频道配置一个 recipient

    Loan Broker 样本对此事有一些配置:https://github.com/spring-projects/spring-integration-samples/tree/master/applications/loan-broker

    此处描述了 Java DSL 变体:https://docs.spring.io/spring-integration/docs/current/reference/html/#java-dsl-routers

    【讨论】:

    • 感谢您的参考。 RecipientListRouter 是我需要的。
    猜你喜欢
    • 2016-04-21
    • 1970-01-01
    • 2021-04-13
    • 1970-01-01
    • 1970-01-01
    • 2016-03-26
    • 1970-01-01
    • 1970-01-01
    • 2013-12-06
    相关资源
    最近更新 更多