0

I have put together an until-succesfull in Mule 3.7 (see below):

<until-successful maxRetries="100" failureExpression="#[exception != null &amp;&amp; (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

max
  • 53
  • 8

2 Answers2

2

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.

1

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]

Manik Magar
  • 1,403
  • 2
  • 10
  • 20
  • The http status is – max Jul 21 '16 at 19:59
  • Thanks Manik. The http status is 500. However, the until-successful keeps trying. Maybe I do not understand the function of the failureExpression. I have also tried || message.inboundProperties['http.status'] == 503] but again it keeps retrying. – max Jul 21 '16 at 20:20
  • Have you tried with parentheses? Failure expression has to return true for until successfully to retry. Try building you condition one at a time and see which one is letting your exception go. – Manik Magar Jul 21 '16 at 22:56
  • I have tried – max Jul 22 '16 at 00:43