Exploring Kafka APIs

Last modified on February 14, 2023

For this tutorial, we will walk through the basics of using API Exploration to subscribe and publish to a Kafka API.

Requirements

To complete this tutorial, you need:

Trying out a Kafka API

You will need to use your own Kafka site for this tutorial, so you will need to adjust the settings appropriately in the following examples.

Subscribing to an event stream

Let's subscribe to an event feed from Kafka. to do that:

  • Set the Protocol to Kafka
  • Set the Operation to Subscribe
  • Paste/enter your server address and channel into the Server and Channel fields.
  • Click on Authorization Settings to specify your login credentials
  • Click on Connection Settings & Properties to specify how long you want the subscription to last

Your screen will look like this:

Click the image to enlarge it.

Finally, click on the Subscribe button to begin your subscription. As events happen, you will see records appear in the Received Data section at the bottom of the window, like this:

Click the image to enlarge it.

You can click on individual event messages to see more detail:

Click the image to enlarge it.

The event stream will end per your settings in Connection Settings & Parameters -- by default after no longer than 60 seconds.

Publishing

To publish with Kafka:

  • Set the Operation to Publish
  • Click on Body and paste the data

Click the image to enlarge it.

Click Publish to complete the publish operation.

Highlight search results