Adding a Kafka API to the Project

To start testing Kafka in ReadyAPI, you should first add a Kafka API to the project. You can import an AsyncAPI definition or create an API manually.

Import API definition

  1. Click next to the APIs node and select Import API Definition.

    Alternatively, right-click the APIs section in the Navigator and select Import API Definition.

  2. Select where your definition is stored and click Import API:

    • My Computer - browse to the definition file on your computer.

    • URL - enter the URL of the definition.

    • Swagger - search for and select the definition from Swagger.

  3. Select the imported API in the Navigator to view its definition. The panel shows the API name, description, and version badges, along with the Servers, Channels, and Specification tabs.

    Note

    ReadyAPI displays two version badges in the top right corner: the AsyncAPI specification version and the definition version. The AsyncAPI version badge is visible only for definitions imported in ReadyAPI 4.3.0 or later. Definitions imported with an earlier version of ReadyAPI do not display this badge.

    ReadyAPI now uses the actual operation names from the AsyncAPI definition in the Navigator, for both AsyncAPI 2.x and 3.0. If you open an existing project in ReadyAPI 4.3.0, operation names in the Navigator may differ from what you saw before.

    ReadyAPI Streetlights Kafka API 3.0 definition panel showing Servers, Channels, and Specification tabs with Async 3.0.0 and Version 1.0.0 badges in the top right corner, and Servers tab displaying two endpoints with Endpoint (host), Pathname, Protocol, Pr

Create API definition

Tip

The built-in Kafka Sample Project contains a test case that simulates a publisher and a subscriber interacting with a topic. You can open it from the Sample Projects section on the Projects tab,or from the Dashboard tab. For more details, see Sample Projects.

  1. Add a Kafka API to the project.

    ReadyAPI Create API Definition dialog showing API Name field with "Kafka API" entered and Protocol set to Kafka, with Create API button.

    To learn more, see Adding More APIs to Existing Projects.

  2. Specify the service’s endpoints and authorization, if needed.

    ReadyAPI Add Endpoint dialog showing Basic Settings tab with Kafka API name, endpoint set to http://localhost:9092, and No Environment selected.

    To learn more, see Managing Kafka APIs.

  3. Populate the API with the needed channels.

    ReadyAPI Add Channels dialog showing a channel named quickstart-events with Publish and Subscribe operations selected, and a New Channel button
  4. Add the API Connection test step to a test case.

    ReadyAPI Add API Connection Test Step dialog showing Kafka API selected in the Choose API panel with quickstart-events channel and Subscribe and Publish operations, and Kafka test case selected in the Choose Test Case panel.

    To learn more, see API Connection Test Step.

Next Steps

See Also

Publication date: