How to use filtering or return from a chain while using enricher pattern
Here is my scenario I am using enricher pattern to retrieve data from a request channel and then use to enrich the payload. The request channel will call multipe webservices to retreive the data. Need to call the second webservice only if the first one has a valid data. If not I need to return to the enricher. When the filter happens I get this exception org.springframework.integration.handler.ReplyRequiredException: No reply produced by handler
Is my message flow correct or need to add something else ?
<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>