API Builder Connectors

Data connector plugins allow you to read and write data to and from an external data source, such as Oracle, MySQL, and MongoDB. They give you the power to interact with your data as part of your flow and create feature-rich microservices.

Currently available

The following data connector plugins are currently available for download directly from npm:

Configuring data connector plugins

When you install a data connector plugin, it will create a configuration file located the <SERVICE_FOLDER>/conf folder and has the name of your connector. For example, mysql.default.js. You will need to edit this file and give it the required connection details such as database host/port, username, password, and database.

The configuration files that can contain environment variables are placed in the <SERVICE_FOLDER>/conf folder.

All the variables in your configuration files taken from "process.env.<VARIABLE_NAME>can be provided when running the Docker container.

The following table lists the configuration files, their location, and their example content. The connector configuration is shown to inform you that you will have to provide an additional set of environment variables when using an API Builder service with connectors.

Configuration File Location Example
Service Configuration <SERVICE_FOLDER>/conf/default.js
module.exports = {
 apiKey: process.env.APIKEY
 port: parseInt(process.env.PORT) || 8080
};
Connector Configuration

Example with MySQL.

The file will be named <SERVICE_FOLDER>/conf/mysql.default.js

module.exports = {
  connectors: {
    mysql: {
      connector: '@axway/api-builder-plugin-dc-mysql',
      connectionPooling: true,
      connectionLimit: 10,
      host: process.env.MYSQL_HOST || 'localhost',
      port: 3306,


	  # This could be set to mysql since this is already available database	by default
      database: 'mysql',


      user: process.env.MYSQL_USER,
      password: process.env.MYSQL_PASSWORD,


      // Create models based on your schema that can be used in your API.
      generateModelsFromSchema: true,

      // Whether or not to generate APIs based on the methods in generated models.
      modelAutogen: false
    }
  }
};

Additional information

For additional information on the connectors:

Related Links