This site contains the documentation that is relevant to older WSO2 product versions and offerings.
For the latest WSO2 documentation, go to https://wso2.com/documentation/.

Message Flow in the API Manager Gateway

The Gateway of an API Manager deployment is responsible for the main business functionality of serving API traffic. The following diagram illustrates the message flow in the Gateway at a very high level. 

The handlers

The handlers are request and response interceptors. The list of API handlers in WSO2 API-M are as follows:

  • APIMgtLatencyStatsHandler
  • CORSRequestHandler
  • APIAuthenticationHandler
  • ThrottleHandler
  • APIMgtUsageHandler
  • APIMgtGoogleAnalyticsTrackingHandler
  • APIManagerExtensionHandler

Each handler performs a specific task as mentioned in the table below. Note that some handlers are functional both at the inflow and outflow of messages.

HandlerInflowOutflow
APIMgtLatencyStatsHandlerPublish request and response latencies, if analytics is enabledPublish request and response latencies, if analytics is enabled
CORSRequestHandlerSet CORS HeadersSet CORS Headers
APIAuthenticationHandlerRequest authenticationN/A
ThrottleHandlerRequest throttlingN/A
APIMgtUsageHandlerPublish request data, if analytics is enabledN/A
APIMgtGoogleAnalyticsTrackingHandlerPublish data to Google Analytics, if Google Analytics is configuredN/A
APIManagerExtensionHandlerExecute custom mediation sequences at inflowExecute custom mediation sequences at outflow

Mediation extensions

Mediation extensions are the custom mediation logic that can be executed in either the inflow or the outflow. For more details on how to configure mediation extensions, see Adding Mediation Extensions

In sequence and out sequence 

The in sequence and out sequence carry the main business logic of the request flow. The in sequence handles sending the request from the client to the backend, while the out sequence routes the response sent from the backed to the client.