Reputation: 53
I have put together an until-succesfull in Mule 3.7 (see below):
<until-successful maxRetries="100" failureExpression="#[exception != null && (exception.causedBy(java.net.ConnectException) || exception.causedBy(java.net.SocketTimeoutException)) || message.inboundProperties['http.status'] != 500]" synchronous="true" millisBetweenRetries="20000" doc:name="UntilSuccess">
<processor-chain>
<set-payload value="#[flowVars.operationPayLoad]" doc:name="GetTransactionRequest" />
<ws:consumer config-ref="GetTransactionWSConsumerConfig" operation="execute" doc:name="GetTransaction" />
</processor-chain>
I am only interested in making the until-successful retry if a web service is down or if it times out. No other exception should be retried by the until-successful.
However, I have done a test where I get a org.mule.module.ws.consumer.SoapFaultException but the until-successful keeps trying to call the web service.
How do I tell the until-successful to ignore all exceptions and stop retrying except for when the web service is down or times out?
Cheers
Max
Upvotes: 0
Views: 2415
Reputation: 76
As is specified in the MuleSoft documentation, the Until Successful scope will retry if an exception is found or the failure expression is true. The failure expression doesn't override the default behavior.
Upvotes: 2
Reputation: 1401
What is the value of message.inboundProperties['http.status']
in your test?
Also, try putting parenthesis -
#[(exception != null && (exception.causedBy(java.net.ConnectException) || exception.causedBy(java.net.SocketTimeoutException))) || message.inboundProperties['http.status'] != 500]
i.e. (when there is an exception of any of those two types) or status is 500. [Added outer parenthesis to exception check]
Upvotes: 1