Choreo Connect Overview

Choreo Connect (the API Microgateway) is a cloud-native, decentralized, lightweight API Gateway designed especially for microservices. Choreo Connect provides API security, rate-limiting, load-balancing, observability and many other API management related quality of services (QoS) while maintaining a high throughput and a low latency.

The following diagram illustrates the basic architecture of Choreo Connect and showcases its main components.

Choreo Connect Basic Architecture

Choreo Connect Components

Choreo Connect consists of the following three components.

Router

The Router is the component that is responsible for routing the traffic from different clients to the desired destination (service). Choreo Connect uses the Envoy Proxy as the core component that does the traffic routing. Choreo Connect exposes the APIs to external clients using the Router.

Enforcer

The Enforcer is the component that enforces the API management capabilities such as security, Rate Limiting, analytics, validation and etc. When the Router within Choreo Connect receives a request, it forwards that request to the Enforcer in order to perform the additional QoS factors such as security, etc. Thereafter, the Enforcer will send a response to the Router. If the latter mentioned response is an allowed response, the Router will forward the request to the actual backend; else if the response is a denied response, then the Router will send a reply back to the client with an error message.

Adapter

The Router and Enforcer have a Data Plane API that can be used to configure them dynamically. When an API needs to be deployed in Choreo Connect, the API definition needs to be translated into the format understood by the Router (convert the API into routes) and the Enforcer. The Adapter is the component that is responsible for the latter mentioned API definition translation. After the API definition is translated, the Adapter will pass the data to both the Router and the Enforcer.

The Adapter, within Choreo Connect, can receive the APIs via the following methods:

  • From the MWARE ESB Control Plane (Publisher).
  • When an API project is pushed via the command line tool apictl.

Communication Between the Components

Communication between internal components of Choreo Connect (Adapter, Enforcer, Router, and API-M Control Plane) are secured via Mutual SSL.

Each component has its private-public key pair and truststore. In the case of the Adapter, it is configured in the Choreo Connect configuration file as indicated below.

Click here to see the configuration file location for your Choreo Connect deployment.

Navigate to the correct folder path and open the config.toml or config-toml-configmap.yaml file based on your Choreo Connect deployment.

DeploymentModeFile nameDirectory
Docker ComposeChoreo Connect as a Standalone Gatewayconfig.toml<CHOREO-CONNECT_HOME>/docker-compose/choreo-connect/conf/
Docker ComposeChoreo Connect with MWARE ESB as a Control Planeconfig.toml<CHOREO-CONNECT_HOME>/docker-compose/choreo-connect-with-apim/conf/
KubernetesChoreo Connect as a Standalone Gatewayconfig-toml-configmap.yaml<CHOREO-CONNECT_HOME>/k8s-artifacts/choreo-connect/
KubernetesChoreo Connect with MWARE ESB as a Control Planeconfig-toml-configmap.yaml<CHOREO-CONNECT_HOME>/k8s-artifacts/choreo-connect-with-apim/
[adapter.keystore] 
certPath = "/home/wso2/security/keystore/mg.pem"
keyPath = "/home/wso2/security/keystore/mg.key"

[adapter.truststore]
location = "/home/wso2/security/truststore"

Choreo Connect Modes

You can use Choreo Connect mainly in the following two modes.

  • Choreo Connect with MWARE ESB as a Control Plane

    By enabling the Control Plane Event Hub in the Choreo Connect configuration file, the APIs deployed in MWARE ESB will automatically be available in Choreo Connect. When using this mode, you can either create an API via MWARE ESB or you can import an API to MWARE ESB using the API Controller (apictl), which is a command line tool.

  • Choreo Connect as a Standalone Gateway

    If you have not started using MWARE ESB yet, or you want to try out Choreo Connect as a Standalone Gateway, simply use the CLI tool apictl to directly deploy APIs to the Choreo Connect Adapter.

Choreo Connect Request Flow

The request flow within Choreo Connect is depicted in the following diagram.

Choreo Connect Request Flow

When a client makes an API request, it is sent to the Router. The Router then forwards the request to the Enforcer. The Enforcer performs validations such as JWT access token validation, rate limiting, and other other validations. Once the API request has been validated, the Router forwards it to the backend service. The Router will respond to the client when the backend service responds. In addition, the Router sends stats about APIs to the Enforcer, and the Enforcer sends final analytics data to the Analytics Server.

See also

Top