Hi Thomas,
How about including your third step in a separate sequence and invoking it
from the fault sequence when it is triggered?

Thanks,
Vinod.

On Wed, Mar 21, 2018 at 8:05 PM, Himasha Guruge <[email protected]> wrote:

> Hi Thomas,
> Could you elaborate on following.
> " And because the second step can be invoked in many contexts, I can't
> just customize the fault sequence to invoke the third step."
>
> How about using switch mediator in fault sequence (for error_code
> property) and based on that, invoke the third step?
>
> Thanks,
> Himasha
>
> On Tue, Mar 20, 2018 at 8:43 PM, Thomas LEGRAND <
> [email protected]> wrote:
>
>> 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
>> [email protected]
>> http://wso2.org/cgi-bin/mailman/listinfo/dev
>>
>>
>
>
> --
> Himasha Guruge
> Senior Software Engineer
> WS*O2* *Inc.*
> Mobile: +94 777459299 <+94%2077%20745%209299>
> [email protected]
>
> _______________________________________________
> Dev mailing list
> [email protected]
> http://wso2.org/cgi-bin/mailman/listinfo/dev
>
>


-- 
Vinod Kavinda
Senior Software Engineer
*WSO2 Inc. - lean . enterprise . middleware <http://www.wso2.com>.*
Mobile : +94 (0) 712 415544
Blog : http://soatechflicks.blogspot.com/
[image: http://wso2.com/signature]
<http://wso2.com/signature>
_______________________________________________
Dev mailing list
[email protected]
http://wso2.org/cgi-bin/mailman/listinfo/dev

Reply via email to