【发布时间】:2020-06-28 21:20:36
【问题描述】:
我有一个带有以下功能的弹簧集成实现:
- 多个发布渠道在一个公共渠道上发布。
- 所有通道都返回相同的响应对象。
- 聚合器试图聚合来自上述所有渠道的响应
问题:聚合器无法将所有响应组合在一起,并且在通道的第一个响应时调用提供的方法
这里是详细信息。我需要做什么来汇总回复?
<int:publish-subscribe-channel id="aggregate-channel" apply-sequence="true"/>
<int:publish-subscribe-channel id="input-channel" apply-sequence="true"/>
<int:service-activator input-channel="input-channel" output-channel="aggregate-channel" ref="...A" method="...A">
<int:service-activator input-channel="input-channel" output-channel="aggregate-channel" ref="...B" method="...B">
<int:service-activator input-channel="input-channel" output-channel="aggregate-channel" ref="...C" method="...C">
<int:service-activator input-channel="input-channel" output-channel="aggregate-channel" ref="...D" method="...D">
<!--This is the aggregator.
**Expecting a list of size 4 but then it gets list of size 1 for each response channel
-->
<int:aggregator input-channel="aggregate-channel" output-channel="gateway-response-channel" ref="Service" method="responseListProcessor"/>
【问题讨论】:
-
responseListProcessor 根据自定义业务逻辑检查处理输入列表以发送网关响应。
标签: spring spring-integration spring-integration-dsl