Skip to main content

Connections

Connection artifacts centralize the configuration for external systems. Define connections once and reuse them across multiple services, event handlers, and functions in your project.

Adding a connection

  1. Open an integration/library in WSO2 Integrator.

  2. Click + next to Connections in the sidebar. Alternatively, click + Add Artifact in the Design panel, then click Connection under Other Artifacts or Library Artifacts.

    WSO2 Integrator Add connection via sidebar

  3. In the Add Connection panel, browse the available connectors. The panel groups them into Create New Connector and Pre-built Connectors. For details on each category and how to choose, see Connection types.

    WSO2 Integrator Add Connection panel

  4. Select a connector. A configuration form appears with fields specific to that connector (for example, base URL and authentication for HTTP, host, port, and credentials for a database, or application/vendor-specific attributes).

    WSO2 Integrator Connection initialization form

  5. Fill in the required fields and click Save Connection.

  6. The new connection appears under Connections in the sidebar and is available for use in any service, function, or event handler in your project.

Editing a connection

To edit an existing connection, click its name in the sidebar under Connections to open its configuration form. Update the fields and click Update Connection.

WSO2 Integrator Connection edit form

Connection types

The Add Connection panel organizes connectors into two categories:

Create New Connector

Generate a new connector locally when a pre-built connector isn't available for the system you need to integrate with:

  • Connect via API Specification: generate a typed HTTP client from an OpenAPI or WSDL file. For more information, see the OpenAPI tool and the WSDL tool.
  • Connect to a Database: generate a typed database client by introspecting the schema of a MySQL, MS SQL, or PostgreSQL database.

Connectors created this way are added directly to your project. To make one reusable across projects, publish it to a registry like Ballerina Central. See Build your own connector and Publish to Ballerina Central.

Pre-built Connectors

Select an already-published connector from the connector library. The panel provides three tabs to filter the catalog by source:

TabWhat it showsSources
AllEvery connector available to your project (standard, extended, WSO2, and your organization's private connectors) in one combined list.ballerina/*, ballerinax/*, wso2/*, <your-org>/*
StandardConnectors maintained as part of the Ballerina platform and its extended library for popular third-party systems.ballerina/* (for example, ballerina/http, ballerina/graphql, ballerina/tcp)
ballerinax/* (for example, ballerinax/mysql, ballerinax/kafka, ballerinax/rabbitmq)
OrganizationConnectors developed and published by your organization.<your-org>/*

For the complete list of available connectors, see the Connector Catalog.

Best practices

PracticeDescription
Use configurable variablesExternalize host, port, and credentials for security and configurability.
Use finalDeclare connections as final and initialize them once at startup.
Retry configurationAdd retry and timeout settings for resilient connections.

What's next