API-led Integration¶
WSO2 API Manager consists of an API management layer as well as an integration layer. While the integration layer (Micro Integrator) is used for running the integration logic, the API management layer is used for managing the APIs (with the integration logic) and making these APIs discoverable to developers.
This allows you to implement an API-led integration strategy by developing the front-end APIs and integration APIs separately. There are two approaches to development when you implement API-led integration: Create the APIs first and then create the integration logic, or create the integration logic first followed by the APIs.
API-First development¶
This development strategy enables you to first design the experience APIs in your API-led integration framework. That is, you will first create the front-end APIs based on business requirements and on how you want consumers to interact with your APIs. At this stage, you don't need to consider how the underlying integration logic is implemented.
Integration developers will then use the Swagger definition of the experience APIs and implement the process APIs that contains the integration logic as well as the system APIs that directly interact with internal and external systems.
The high-level steps are as follows:
-
Create the API proxy
Open the Publisher of WSO2 API-M and create a new API using a Swagger definition (OpenAPI specification). This will be your experience API. The production endpoint of your experience API should point to the process API or system API that is deployed in the integration layer (Micro Integrator runtime) of the API-M platform.
Tip
At the time of creating this API, you will not have the production endpoint ready. However, you can still publish this API using a prototype endpoint of your choice. You can even provide prototype implementations for the API as required. Once published as a prototype, you can test the API.
You can manage the API proxy by applying business plans, rate-limiting policies, security mechanisms, etc.
-
Create the integration service
Download the Swagger definition of your API proxy from the Publisher and import it as a REST API to your WSO2 Integration Studio. The base integration sequences will be generated by default. You can now use the features in WSO2 Integration Studio and develop the integration logic that should apply to the API.
-
Connect the API proxy and integration service
Once you have created the integration service and tested it, you can create a CApp and deploy it in the Micro Integrator of WSO2 API-M and start the Micro Integrator.
Integration-First development¶
With this development strategy, integration developers will first create the process APIs (with the integration logic) or the system APIs. These integration services are published to the service catalog in the API management layer. API creators will then convert these integration APIs to experience APIs.
The high-level steps are as follows:
-
Create the integration service
Create a REST API artifact and define the integration logic using WSO2 Integration Studio. Note that the resources that are required for publishing the integration service to the API management layer are generated. You need to update this metadata by providing the connection parameters of your API-M runtime.
-
Publish the integration service
Once you have created the integration service and deployed it in the Micro Integrator, you only need to start the two servers (API-M server and the Micro Integrator server). Note that the API-M server should be started before the Micro Integrator. The Service Catalog client in the Micro Integrator publishes the integration services to the API-M layer during server startup.
-
Create the API proxy
Open the Publisher and see that the integration service is listed in the service catalog. You can now create an API proxy for this integration service from the Publisher. This will be the experience API of your integration service.
Because the integration service is already running in the integration layer, the production endpoint of your experience API is already updated to connect with the integration layer.
You can now manage the API proxy by applying business plans, rate-limiting policies, security policies, etc., and then expose the API to consumers from the API store (marketplace).