Pathfinder
Pathfinder

Reputation: 994

Mule Untilsuccessful failure expression not working

I have given my until successful as below, but still even though i get a 200 response it is trying to call the flow "test" back again.

<until-successful maxRetries="2" millisBetweenRetries="1500" failureExpression="#[message.inboundProperties['http.status'] != 200 or 202 or 500]" synchronous="true" doc:name="Until Successful">
  <flow-ref name="test" doc:name="test"/>
</until-successful>

If I give only one code in this way it is working fine

<until-successful maxRetries="2" millisBetweenRetries="1500" failureExpression="#[message.inboundProperties['http.status'] != 200]" synchronous="true" doc:name="Until Successful">
      <flow-ref name="test" doc:name="test"/>

</until-successful>

I've tried giving the expression as follows too, but not working

failureExpression="#[message.inboundProperties['http.status'] != 200 || message.inboundProperties['http.status'] !=202]" 

Can someone please help me with the syntax

Upvotes: 0

Views: 169

Answers (1)

RegularMike
RegularMike

Reputation: 26

your expression says Status != 200 || Status != 202 that means in case of status = 200 you fail second condition and in case of status = 202 you fail first condition

what you could do is to define: fail is when Status != 200 AND Status !=202 AND Status !=500

failureExpression="#[message.inboundProperties['http.status'] != 200 && #[message.inboundProperties['http.status'] != 202 && #[message.inboundProperties['http.status'] != 500]"

Upvotes: 1

Related Questions