I code a Spring Integration route that queries a SOAP and a REST WS and somehow aggregates the results. I use a bean as payload to gather the useful information along the way, two payload enrichers to query the web services and a transformer at the end to build the result.
Now my problem is that the REST WS returns (by design) HttpStatus.NOT_FOUND (404) if the system has no information about the entity I'm querying. That needs be considered a nominal use case. Spring Integration considers this by default an error and bails out. I need to handle this case properly, store null in my bean or something similar (I can handle that down the road) and proceed.
So I've tried adding an error-handler to the outbound-gateway but could not make this work. If I tell this is not an error (overriding hasError()) then SI tries to unmarshall the body of the response, which obviously does not work; same if I override handleError() and do nothing.
Maybe I'm not going in the right direction but I miss a better idea so... any help accepted with gratitude.