The "Data Service Integration" sample demonstrates how to create an integration that integrates with a relational database management system (RDBMS) and exposes employee information stored in the database as a REST API. To use this sample with Choreo, follow these steps:
- Start a MySQL instance and create a database (for example,
misampledb
). - Import the script to create the schema and populate employee data.
- Identify the publicly accessible connection URL and credentials for the database.
- Login to Choreo console
- Select the iPaaS profile and create a new component named
Integration as an API
- Provide a name and description for the component.
- Authorize and select the GitHub details
- Select the
GitHub Account
and the forked repository forGitHub Repository
- Select the
Branch
asmain
- Select
WSO2 MI
asBuild Preset
- Enter
MIdata-serviceChoreo
as theProject Path
- Enter
MIdata-serviceChoreo/openapi.yaml
as theOpenAPI File Path
- Click on "Create" to create the component.
- Once the component is created, go to the "Deploy" section and click on the "Deploy Manually" button.
- The database details need to be passed as environment variables.
- To do this, go to the DevOps portal and select the component and "Configs & Secrets" to configure the environment variables.
- Click on "Create" and select "Environment Variables" as the configuration type.
- Give a name for the
Config Name
- Add key-value pairs to register them as environment variables. For example:
DB_DRIVER_CLASS
forKey
andcom.mysql.jdbc.Driver
forValue
DB_CONNECTION_URL
forKey
andjdbc:mysql://<public ip or hostname>:3306/misampledb
forValue
DB_USER
forKey
and db username forValue
DB_PASS
forKey
and db password forValue
- Click on
Finish
to apply the changes