Execution Flow of steps in fault rule when one of the step has error

Hi Experts,

I have couple of questions related to fault rules.

1. If there is fault in the target endpoint flow, then fault rule with matching condition under target endpoint executes. Question here is will proxy endpoint fault rules also processed and executed or the execution terminates after target endpoint fault rule execution ?

2. If there are multiple steps in a fault rule and if an error occurs in step1, then will step2 gets executed or not ?

 

Thanks
Pradeep

Solved Solved
0 3 366
1 ACCEPTED SOLUTION

Hi Pradeep

regarding #1

If there is fault in the target endpoint flow, then fault rule with matching condition under target endpoint executes. Question here is will proxy endpoint fault rules also processed and executed or the execution terminates after target endpoint fault rule execution ?

Here is what I observed:

  • if a fault occurs in a target (eg, non-success code returned from target), then the FaultRules configured for the target endpoint execute. The FaultRules for the proxy endpoint do not execute. The DefaultFaultRule in the proxy endpoint will also execute.
  • if a fault occurs in a proxy, for example due to RaiseFault or if a VerifyAccessToken rejects a token, then the FaultRules configured for the proxy endpoint will execute. The DefaultFault rule in the proxy endpoint will also execute.

 

The proxy bundle attached here will illustrate for you, via distinct AssignMessage policies attached to the various fault handling anchors in the target endpoint and proxy endpoint. Each distinct AssignMessage policy assigns a different header. By examining the headers in the response, you can deduce which AssignMessage policies executed, and therefore which of the FaultRules executed.

Check the README for more details.

View solution in original post

3 REPLIES 3

About two - Fault rules :

 

The order in which the FaultRules are evaulated, top to bottom or bottom to top, differs between the TargetEndpoint and ProxyEndpoint, as described in the: https://docs.apigee.com/api-platform/fundamentals/fault-handling#executionlogic

 

I think that Fault rule will execute only when is a Fault state from one of the policies or flows, so endpoint condition will be there first

 

Hi Pradeep

regarding #1

If there is fault in the target endpoint flow, then fault rule with matching condition under target endpoint executes. Question here is will proxy endpoint fault rules also processed and executed or the execution terminates after target endpoint fault rule execution ?

Here is what I observed:

  • if a fault occurs in a target (eg, non-success code returned from target), then the FaultRules configured for the target endpoint execute. The FaultRules for the proxy endpoint do not execute. The DefaultFaultRule in the proxy endpoint will also execute.
  • if a fault occurs in a proxy, for example due to RaiseFault or if a VerifyAccessToken rejects a token, then the FaultRules configured for the proxy endpoint will execute. The DefaultFault rule in the proxy endpoint will also execute.

 

The proxy bundle attached here will illustrate for you, via distinct AssignMessage policies attached to the various fault handling anchors in the target endpoint and proxy endpoint. Each distinct AssignMessage policy assigns a different header. By examining the headers in the response, you can deduce which AssignMessage policies executed, and therefore which of the FaultRules executed.

Check the README for more details.

Hi @dchiesa1 

Thanks for the reply.

Any idea on the #2 question ? Will policy in second step of a fault rule executes if the policy on first step errors out ?

Thanks in advance.