Contents

Popular

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

This section provides a set of standards that can be followed as best practices to be followed in terms of design, configuring, monitoring, and debugging while developing API proxies. The data provided in the this section is a collective contribution of developers who use Fiorano API Management extensively for developing API programs.

...

  • Include a Version Number in the API Proxy path to keep track of Project changes while updating or upgrading a project.
  • Provide a higher version number if there is a major change in the API Policy ConfigurationsConfiguration. For example, 1.0 to 1.1 or 2.0.
  • Retain the older projects in the Version Control System such as Subversion (Svn) and Git. 
  • Change the status of the older versions of a project to DEPRECATED/RETIRED.

...

  • If there are multiple backend services, define all of them as targets and configure Load Balancing.
  • Configure Failover target as an internal service where all the failed requests will be logged into onto a database/file.

    • Use context variable target.failover.occurred in the flow to identify the failed requests and prepare an appropriate response to the client.

      Info

      target.failover.occurred variable will be true if the request hits the failover target.

  • Set context variable target.id as FIORANO_NO_TARGET to skip the target invocation.
  • Make use of the Enable Retries and the Retry Count properties to handle short-term network fluctuations.
  • Provide appropriate values for the Request Timeout and the Connection Timeout properties to reduce response delays in case of target outage.

...

  • Define a resource with base path "/" so that undefined request paths will be responded with proper error message.

    Warning

    Keep this dummy resource at the end of all resources.

  • To pass through all the resource paths, enable the Forward Base Path To Target property.
  • If a request is qualified for multiple resources, the first resource in the list will be invoked.

...

  • Apply Security policies in the Proxy_Request scope or before the business logic policies.
  • If the backend target provides the same response as that for an input, then use the Cache policies.
  • Handle all the exceptions in JAVA callout policy to avoid sleep calls in the Java code.

...

  • After configuring the API Project, debug the policies to verify the responses and to fix runtime API issues.
  • If there are any exceptions while applying the policies, the details of the error stack trace will be logged and the same can be viewed from the Logs tab in the Administration section.
  • The number of error transactions can be checked in the Analytics view.

Error Handling

  • Use the Build Message policy policy  policy in the POLICY ERROR scope to create an appropriate error message that suggests a solution to the error condition.
  • The Context Variables error.occured will be true if an error occurs in the flow.
  • Context variable error.type indicates whether the an error is occurred in the target, cache or in any a policy which that can be identified with the context variable values values "target", "cache" and "policy" respectively.
  • Context variable error.policy.name contains the policy instance name referring to the policy which invoked the error.
Adaptavist ThemeBuilder EngineAtlassian Confluence