Using PostClientFlow with fault handling

1 2 754

For all errors other than policy errors, and for policy errors where the continueOnError element is "false", an API proxy immediately enters the Error flow. Once the API proxy enters the Error flow, it cannot return processing back to the normal flow pipeline.

Edge now supports the PostClientFlow in the response flow, which executes after the response is returned to the requesting client app. Only MessageLogging policies can be attached to this flow, which are executed after the response is sent.

The PostClientFlow is special in two ways:

  1. It only executed as part of the response flow.
  2. It is the only flow executed after the proxy enters the Error flow.

Because it is executed regardless of whether the proxy succeeded or failed, you can put MessageLogging policies in the PostClientFlow and be guaranteed that they always execute.

The following Trace image shows a MessageLogging policy executing as part of the PostClientFlow, after the default fault rule executes:

1142-postclientflow.png

In this example, the VerifyAPIKey policy caused the fault because of an invalid key.

Shown below is the ProxyEndpoint definition that incudes the PostClientFlow:

<ProxyEndpoint name="default">
  ...
  <PostClientFlow>
    <Response>
      <Step>
        <Name>Message-Logging-1</Name>
      </Step>
    </Response>
  </PostClientFlow>
  ...
</ProxyEndpoint>
Comments
ozanseymen
Staff

I guess it should say in first para "ContinueOnError element is false" instead of "true" for the criteria to enter the error flow?

sgilson
New Member

Thanks - fixed.

Version history
Last update:
‎09-11-2015 07:52 AM
Updated by: