Complete the following steps to attach the PingIntelligence policy to your API:
Note: If you are applying the PingIntelligence policy in MuleSoft 3.9 and there is an earlier version of the policy already applied to your API, then remove the policy before applying PingIntelligence 4.3 policy. To remove the policy, follow the steps explained in Remove existing PingIntelligence policy.
  1. Log in to your MuleSoft Anypoint account.
  2. Navigate to the API manager and click on the Version of the API to which you want to attach the PingIntelligence policy.
  3. On the API page, click on Policies as shown in the following illustration.

    The Policies page supports applying the PingIntelligence policy to the API. Click on Apply New:

  4. In the Select Policy pop-up window, select the PingIntelligence Policy and click on Configure Policy.
  5. In the Apply policy page, enter the following values:
    • ASE Token that was generated as part of Prerequisites.
    • ASE primary and secondary host and port. The traffic is sent to the ASE secondary host only when the primary ASE node is unreachable.
    • Enable SSL for a secure HTTPS connection between MuleSoft and PingIntelligence ASE.
    • Check the Allow self-signed certificate check-box to enable MuleSoft to accept a self-signed certificate from ASE.
    • If the Allow asynchronous (non-blocking) request forwarding check box is selected, the API Gateway will not wait for a response from ASE before propagating the inbound request.
      Note:

      The asynchronous Option is only available in the PingIntelligence MuleSoft Java policy.

    • Configure the Connection Timeout and Read Timeout. The behavior of the API gateway is governed by Connection Timeout and Read Timeout, in the event of API Gateway not able to connect to ASE or the response from ASE is delayed.
      Timeout parameter Description
      Connection Timeout It governs the time the API gateway waits to establish a connection with ASE, following which it sends the client request to the backend server.
      Read Timeout It governs the time the API Gateway waits for ASE's response before sending the request to the backend server.

      The default value is 5000 milliseconds or 5 seconds. It is a good practice to configure a small value to limit the delay in case ASE is not reachable or unresponsive.

    Note:

    If there are any changes to the ASE endpoints, repeat the process explained in step 5 and redeploy the configuration.

  6. Navigate to your API and click on version number as described in step 1. On the API page, scroll down to the Deployment Configuration section and click on Redeploy.

Extracting response metadata for APIs with Basic endpoint

If your API is configured with basic endpoint on MuleSoft version 3.9.x, then add the following properties in your Mule application:

  • http.status
  • http.reason
  • content-type
  • content-length
You can use set-property element to configure these properties in the Mule application. If required, you can also set other response side headers to send more information to the PingIntelligence policy. The following is a sample configuration of setting response side details. For more information on setting the properties in a Mule application, see property transformer.

<set-property propertyName="http.status" value="200" doc:name="Property"/>
<set-property propertyName="http.reason" value="OK" doc:name="Property"/>
<set-property propertyName="content-type" value="application/json" doc:name="Property"/>
<set-property propertyName="content-length" value="21" doc:name="Property"/>
<set-property propertyName="set-cookie" value="PHPSESSIONID=CookieValue" doc:name="Property"/>