You can generate an AsyncAPI document from your published event endpoints in Event Endpoint Management, and then import this AsyncAPI into IBM API Connect. After you imported the AsyncAPI document into API Connect, you can use the API Manager to socialize this event-driven API in the Developer Portal, enabling the management of events and APIs in one place.
Before you begin, ensure that you configure your Event Manager as an Event Gateway Service.
Generating an AsyncAPI document for use in IBM API Connect 10.0.8 and later
In IBM API Connect 10.0.8 or later, you can generate and import a new AsyncAPI document from a configured Event Endpoint Management instance into API Connect in a single step. Each AsyncAPI maps to a published event endpoint in Event Endpoint Management.
Configure a Catalog in API Connect
See the API Connect documentation for steps about how to configure a Catalog. When selecting the gateway service to use with the Catalog, choose the Event Gateway Service that you created when you configured Event Manager as an Event Gateway Service.
Generate and import a new AsyncAPI from Event Endpoint Management into IBM API Connect
To import the AsyncAPI document into IBM API Connect, complete the following steps in the API Manager UI.
- In the navigation pane, click Develop, select the APIs tab, then click Add > API.
- From the toggle menu at the top of the screen, select AsyncAPI. Note If you do not see the AsyncAPI option, register your Event Gateway Service in the sandbox catalog settings by using the API Manager Catalog page.
- Select the AsyncAPI from your Event Gateway Service that you want to import, and click Next.
- The AsyncAPI definition is generated and created in API Connect. Click Done to complete the flow.
Note: You cannot import AsyncAPI documents into API Connect from Event Endpoint Management where the published event endpoint has an approval control applied.
Publish the API and Product
See the API Connect documentation for information about how to publish an API and a Product. When publishing the Product, select the Catalog you configured earlier.
Create a subscription to the Product
In the Developer Portal for the Catalog you created, subscribe to the Product.
Use subscription credentials to consume through the Event Gateway Service
Using the credentials that you retrieved from the Developer Portal, you can configure a client application to consume from the topic.
Generating an AsyncAPI document for use in IBM API Connect 10.0.6 and 10.0.7
Configure a Catalog in API Connect
See the API Connect documentation for steps about how to configure a Catalog. When selecting the gateway service to use with the Catalog, choose the Event Gateway Service that you created when you configured your Event Manager as an Event Gateway Service.
Export an AsyncAPI from Event Endpoint Management
To export an AsyncAPI for your topic, complete the following steps.
- In the Event Endpoint Management UI, go to the Manage topics page, and select the topic that you want to export.
- Click the Options tab.
- Click More options on the option that you want to use in API Connect.
- Click Export AsyncAPI. A dialog is displayed.
- Select For IBM API Connect (contains credentials) as the export format, then click Export.
Note: You cannot export options that contain approval control to API Connect.
An AsyncAPI document that describes the topic is downloaded as a YAML file.
Configure a Catalog in API Connect
See the API Connect documentation for steps about how to configure a Catalog. When selecting the gateway service to use with the Catalog, choose the Event Gateway Service that you created when you configured your Event Manager as an Event Gateway Service.
Import by using existing definition of AsyncAPI from Event Endpoint Management into IBM API Connect
To import the AsyncAPI document, complete the following steps in the API Manager UI.
- In the navigation pane, click Develop, select the APIs tab, then click Add > API.
- From the toggle menu at the top of the screen, select AsyncAPI. Note If you do not see the AsyncAPI option, register your Event Gateway Service in the sandbox catalog settings by using the API Manager Catalog page.
- Select AsyncAPI from Event Endpoint Management and click Next.
- Upload the AsyncAPI you downloaded from Event Endpoint Management. Leave the Username and Password fields empty, and then click Next.
-
Select the Gateway tab. Enter the bootstrap server address for your cluster under Bootstrap Servers, and then click Next.
Note: When adding the API for the first time, if the Bootstrap Servers field contains
${bootstrapServerAddress}
, connections to your Kafka cluster are automatically configured. - Select the Activate API checkbox, and choose your catalog to publish the API to in the Target catalog drop-down menu.
- Click Next again to create the API.
Publish the API and Product
See the API Connect documentation for information about how to publish an API and a Product. When publishing the Product, select the Catalog you configured earlier.
Create a subscription to the Product
In the Developer Portal for the Catalog you created, subscribe to the Product.
Use subscription credentials to consume through the Event Gateway Service
Using the credentials that you retrieved from the Developer Portal, you can configure a client application to consume from the topic.