Hello,

I have a situation where I want to retrieve data from two sources. So, the
client sends a request to a specific resource of an ESB API and the
sequence follows like this :

- retrieve the data from the local source
- retrieve a corresponding id for the other source
- if the correspondence exists, retrieve the data from the other source

In the second step, I call a little REST web service which returns a 404
when the correspondence does not exists. The call is implemented by using a
Address mediator, like this:

<call blocking="true">
        <endpoint>
            <address format="get" uri="${getCorrespondenceUrl}"/>
        </endpoint>
</call>

Of course, as you can see, the "getCorrespondenceUrl" is built just before
thanks to registry parameters. My problem is the Address endpoint takes the
404 code as an error and just stop the sequence:

TID: [-1234] [] [2018-03-20 15:48:45,114]  INFO
{org.apache.axis2.transport.http.HTTPSender}
-  Unable to sendViaGet to url[http://blablabla/find/my/correspondence]
{org.apache.axis2.transport.http.HTTPSender}
org.apache.axis2.AxisFault: Transport error: 404 Error: Not Found

So, I tried to use a fault sequence by setting the onError attribute:

<sequence name="getCorrespondenceSequence" onError="
getCorrespondenceFaultSequence" trace="disable" xmlns="http://ws.apache.org/
ns/synapse">
</sequence>

However, once this sequence is triggered, there is no turning back to the
third step. And because the second step can be invoked in many contexts, I
can't just customize the fault sequence to invoke the third step.

So, is there a way to tell the mediator that 404 is no big deal?

Regards,

Thomas
_______________________________________________
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev

Reply via email to