【发布时间】:2014-06-18 03:14:40
【问题描述】:
如何在使用丰富模式时使用过滤或从链中返回
这是我的场景 我正在使用丰富器模式从请求通道中检索数据,然后用于丰富有效负载。 请求通道将调用多个 Web 服务来检索数据。仅当第一个具有有效数据时才需要调用第二个 Web 服务。如果没有,我需要返回浓缩器。 当过滤器发生时,我得到这个异常 org.springframework.integration.handler.ReplyRequiredException: No reply generated by handler
我的消息流是否正确或需要添加其他内容?
<si:enricher id="enricher" input-channel="channelone"
request-channel="retrieveDataChannel" output-channel="outputChannel" >
<si:property name="amount" expression="payload.amount"/>
</si:enricher>
<si:chain id="dataChain" input-channel="retrieveDataChannel" >
<si:header-enricher >
<si:header name="Content-Type" value="application/json" />
</si:header-enricher>
<si-http:outbound-gateway id="Gateway1"
url="http://$webservice{host}"
http-method="POST"
rest-template="restTemplate"
expected-response-type="com.xxx.response.Response1">
</si-http:outbound-gateway>
<si:filter expression="payload.amount lt 30" />
<si-http:outbound-gateway id="Gateway2"
url="http://$webservice{host}"
http-method="POST"
rest-template="restTemplate"
expected-response-type="com.xxx.response.AmountResponse">
</si-http:outbound-gateway>
</si:chain>
【问题讨论】: