Home Ask Login Register

Developers Planet

Your answer is one click away!

Ashwini February 2016

WSO2 ESB- Error Handling - On Error Sequence

For which are all the mediators onError Sequence works?

ex: I tried Enrich mediator it didn't work and send mediator it worked.

<inSequence onError="errorhandler" xmlns="http://ws.apache.org/ns/synapse">
    <source clone="true" type="custom" xpath="//Body/xs"/>
    <target action="replace" property="ORIGREQUES" type="property"/>

Here given xpath is wrong. In wso2Carbon.log got the below message.

ERROR {org.apache.synapse.mediators.elementary.EnrichMediator} - Specified node by xpath cannot be found. {org.apache.synapse.mediators.elementary.EnrichMediator}

<api xmlns="http://ws.apache.org/ns/synapse" name="addTripService" context="/trip" hostname="localhost" port="8280"> <resource methods="POST" uri-template="/add/v2" faultSequence="fault">
  <inSequence onError="errorhandler">
        <source clone="true" xpath="//Body/xs"/>
        <target type="property" property="ORIGREQUES"/>

Here getting the error message whatever I have given in Errorhandler sequence.

This means that onError Sequence works for send mediator and not for enrich mediator. So please let me know for which all mediators it works?

Thanks in advance.


Nadeeshaan February 2016

This [1] article contains detailed description about error handling in WSO2 ESB. Go through it and you will understand how the mediators works and how to handle the errors properly.

[1] http://wso2.com/library/articles/2012/10/wso2-esb-examples-best-practises-error-handling-wso2-esb/

Post Status

Asked in February 2016
Viewed 3,080 times
Voted 7
Answered 1 times


Leave an answer

Quote of the day: live life