Develop an integration as an API service¶
Choreo simplifies the process of building, deploying, and managing integration components, making it easy to expose integrations as APIs. This guide walks you through the steps to expose an integration as a managed API service in Choreo.
In this guide, you will: - Create a component to expose an integration using a sample from the Choreo samples repository. - Deploy, test, and observe the integration component. - Publish the integration component as an API to the Choreo Developer Portal.
Note
To develop integrations for Manual Task and Schedule Task components in Choreo, use the automation mode in the WSO2 Micro Integrator. See Running MI in Automation Mode.
Prerequisites¶
- If you're signing in to the Choreo Console for the first time, create an organization:
- Go to the Choreo Console and sign in.
- Enter a unique organization name. For example,
Stark Industries
. - Read and accept the privacy policy and terms of use.
- Click Create. This creates the organization and opens the Project Home page.
Step 1: Create the integration component¶
- Go to the Choreo Console and sign in. This opens the Project Home page.
- If you already have one or more components in your project, click + Create. Otherwise, proceed to the next step.
- Click the Service card.
- Click Use Public GitHub Repository.
-
Enter the following repository details:
Field Description Repository URL https://github.com/wso2/choreo-samples Branch main
Component Directory /hello-world-mi
-
Provide a unique name and description for the component:
Field Value Display Name Hello World
Name This will be automatically generated based on the display name. Description MI Hello World REST API
-
Select
WSO2 MI
as the Build Preset. -
Click Create and Deploy. Choreo initializes the component, builds it, and deploys it to the development environment.
Step 2: Test the integration¶
- In the Choreo Console left navigation menu, click Test and then click Console.
- In the OpenAPI Console, select Development from the environment drop-down list.
- Expand the GET / operation.
- Click Try it out, then click Execute. This sends a request to your deployed integration.
-
Check the response:
- In the Response body section, observe the response. If the integration works as expected, you should see:
Step 4: Observe the integration¶
- In the Choreo Console left navigation menu, click Observability and then select one of the following options to monitor the performance of the integration component:
- Alerts: View and configure alerts based on predefined conditions.
- Metrics: Monitor performance metrics and system statistics.
- Runtime Logs: Access and analyze runtime execution logs.
For more details, see Observability Overview.
Step 5: Publish the integration component¶
- In the Choreo Console left navigation menu, click Manage and then click Lifecycle.
- The Lifecycle Management pane shows the current lifecycle stage as Created.
- Click Publish. This changes the lifecycle stage to Published and exposes the integration as an API in the Choreo Developer Portal.
- To view the published API, click Go to Devportal. In the Developer Portal, you can manage subscriptions and generate access tokens for testing.
Now you have successfully exposed a WSO2 MI integration as a REST API in Choreo!