【发布时间】:2017-10-10 15:48:48
【问题描述】:
我正在尝试设计一个需要使用多个端点处理消息的消息处理管道。在每个阶段,端点返回有效负载(可以转换)或错误消息。这是我脑海中的一个通用示例:
<int:payload-type-router input-channel="preprocessing-output">
<int:mapping type="com.example.Error" channel="error" />
<int:mapping type="com.example.PreprocessedDomainObject" channel="validation-input"/>
</int:payload-type-router>
<int:service-activator input-channel="validation-input"
ref="validationService" method="validate" output-channel="validation-output"/>
<int:payload-type-router input-channel="validation-output">
<int:mapping type="com.example.Error" channel="error" />
<int:mapping type="com.example.CouldBeAnotherObject" channel="processor-input"/>
</int:payload-type-router>
等等,这个处理链可能很长......有没有更好的方法来设计这个而不是在每个阶段之后设计一个有效负载类型的路由器?感觉有点多余。
【问题讨论】: