Deploying Choreo Connect on Docker With WSO2 API Manager as a Control Plane

Let's deploy an API on Choreo Connect, which running on Docker, with WSO2 API Manager as the Control Plane.

Info

Before you begin

  • Make sure you have installed Docker and Docker Compose on your machine.

  • Download the latest from https://wso2.com/choreo/choreo-connect/ and extract it to a folder of your choice. The extracted folder will be referred to as CHOREO-CONNECT_HOME here onwards.

  • This guide assumes that you have already started the WSO2 API Manager instance. If not, download the latest release and follow the steps here.

Step 1 - Find the APIM IP Address

In order to tell Choreo Connect where API Manager (APIM) is located, find out the IP that can be used to access the API Manager instance. If you are trying out WSO2 API Manager locally, the private IP retrieved using hostname -I or ipconfig would do.

Step 2 - Update the Choreo Connect Configuration File

Open the <CHOREO-CONNECT_HOME>/docker-compose/choreo-connect/conf/config.toml file in a text editor and update it as follows.

In the [controlPlane] section,

  • Set enabled to true
  • Update serviceURL and brokerConnectionParameters with the IP of API Manager. (Search for apim and replace them with the IP. Alternatively, add an entry to the /etc/hosts file as <ip-of-apim> apim)
  • If you want to use a Gateway Environment other than the default, update environmentLabels with the name of the new Gateway Environment. If not, leave the value "Default" as it is.

Example

[controlPlane]
 enabled = true
 serviceURL = "https://<apim-ip>:9443/"
 username="admin"
 password="$env{cp_admin_pwd}"
 environmentLabels = ["Default"]
 retryInterval = 5
 skipSSLVerification=true

 [controlPlane.brokerConnectionParameters]
   eventListeningEndpoints = ["amqp://admin:$env{cp_admin_pwd}@<apim-ip>:5672?retries='10'&connectdelay='30'"]
   reconnectInterval = 5000
   reconnectRetryCount = 60

 [controlPlane.httpClient] 
   requestTimeOut = 30

Tip

In API Manager, a new Gateway Environment can be created from the Admin Portal (available at https:<apim-host>:<apim-port>/admin) Gateways tab.

Step 3 - Start Choreo Connect

Now, let's start Choreo Connect. Navigate to <CHOREO-CONNECT_HOME>/docker-compose/choreo-connect and execute the following command.

Click here if you are using an ARM64 based machine (e.g., Apple M1)

If you are trying this out in an ARM64 based machine (e.g., Apple M1), update the Docker image names with the following:

  • docker-compose.yaml files
    • <CHOREO-CONNECT_HOME>/docker-compose/choreo-connect/docker-compose.yaml
    • <CHOREO-CONNECT_HOME>/docker-compose/choreo-connect-with-apim/docker-compose.yaml
Existing (Default) image name Image name for tryout in ARM64 (e.g.: Apple M1)
wso2/choreo-connect-adapter:1.0.0 wso2/choreo-connect-adapter:1.0.0-ubuntu
wso2/choreo-connect-enforcer:1.0.0 wso2/choreo-connect-enforcer:1.0.0-ubuntu
wso2/choreo-connect-router:1.0.0 wso2/choreo-connect-router:1.0.0-ubuntu
wso2/wso2am:4.0.0-alpine wso2am/wso2am:4.0.0-ubuntu

Note:
Note that the above Ubuntu based (*-ubuntu) images are for tryout purpose only, not recommended for a production deployment.

docker-compose up -d

Step 4 - Deploy the sample API via WSO2 API Manager

Follow the instructions in create and publish an API from API Manager.

Top