Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I would change the approach rather than using an interceptor. If you need to invoke the exception strategy wihout triggering the until-succesful router first, I would move your cxf:jaxws-client etc. to a private flow. To quote Mule in Action 2nd edition on private flows: </p> <blockquote> <p>This decoupling allows defining processing and error handling strategies that are local to the private flow.</p> </blockquote> <pre><code>&lt;flow name="ProvaClient" doc:name="ProvaClient"&gt; ... &lt;until-successful objectStore-ref="OS_Bean" maxRetries="2" secondsBetweenRetries="2" doc:name="Until Successful" deadLetterQueue-ref="myQueue"&gt; &lt;processor-chain doc:name="Processor Chain: Wait For Web Service Response"&gt; &lt;processor-chain doc:name="Processor Chain: Web Service"&gt; &lt;flow-ref name="externalCallFlow" /&gt; &lt;/processor-chain&gt; &lt;logger message="PAYLOAD: #[payload]" level="INFO" doc:name="Logger" /&gt; &lt;/processor-chain&gt; &lt;/until-successful&gt; ... &lt;/flow&gt; &lt;flow name="externalCallFlow"&gt; &lt;cxf:jaxws-client operation="getCode" clientClass="it.aizoon.prova.client.ProvaService" port="ProvaPort" enableMuleSoapHeaders="true" doc:name="SOAP"&gt; &lt;/cxf:jaxws-client&gt; &lt;http:outbound-endpoint exchange-pattern="request-response" host="localhost" port="8081" path="service/prova" method="POST" doc:name="HTTP" /&gt; &lt;catch-exception-strategy doc:name="Catch Exception Strategy"&gt; &lt;!-- Handle exception here locally and return custom exception or error message for the unil-successful router --&gt; &lt;/catch-exception-strategy&gt; &lt;/flow&gt; </code></pre> <p>You can then handle exceptions locally and return a custom exception or error message for the until-successful router to catch using the following attribute: failureExpression="exception-type:java.lang.NumberFormatException"</p> <p>Here's a dummy example I knocked up to throw a NumberFormatException, log the exception in the exception strategy and retry:</p> <pre><code>&lt;flow name="test" doc:name="test"&gt; &lt;http:inbound-endpoint address="http://localhost:8081/test" doc:name="HTTP" /&gt; &lt;until-successful objectStore-ref="OS_Bean" maxRetries="2" secondsBetweenRetries="2" doc:name="Until Successful"&gt; &lt;processor-chain doc:name="Processor Chain: Wait For Web Service Response"&gt; &lt;processor-chain doc:name="Processor Chain: Web Service"&gt; &lt;flow-ref name="externalCallFlow" doc:name="Flow Reference" /&gt; &lt;/processor-chain&gt; &lt;/processor-chain&gt; &lt;/until-successful&gt; &lt;/flow&gt; &lt;flow name="externalCallFlow" doc:name="externalCallFlow"&gt; &lt;scripting:component&gt; &lt;scripting:script engine="groovy"&gt; throw new java.lang.NumberFormatException(); &lt;/scripting:script&gt; &lt;/scripting:component&gt; &lt;default-exception-strategy&gt; &lt;processor-chain&gt; &lt;logger level="ERROR" message="NumberFormatException Occurred : #[message.payload.getException().getCause()]" /&gt; &lt;scripting:component&gt; &lt;scripting:script engine="groovy"&gt; throw message.payload.getException().getCause(); &lt;/scripting:script&gt; &lt;/scripting:component&gt; &lt;/processor-chain&gt; &lt;/default-exception-strategy&gt; &lt;/flow&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload