Explore Kafka Services

Last modified on February 14, 2023

This tutorial, demonstrates the basics of using SwaggerHub Explore to subscribe and publish to a Kafka service.

Requirements

To complete this tutorial, you need:

Kafka API Event Stream Example

You need to use your own Kafka site for this tutorial. As a result, you also need to adjust your settings in the following examples.

Subscribe to an event stream

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

  • From the Protocol menu, select Kafka.
  • From the Operation menu, select Subscribe.
  • In the Server field, enter your server address.
  • In the Channel field enter your channel.
  • Click Authorization Settings and complete the required fields for your login credentials.
  • Click Connection Settings & Parameters and complete the required fields to specify how long you want the subscription to last.
  • Click Subscribe to begin your subscription.

    As events happen, the Received Messages section starts to display records, with the most recent at the top.

  • Click individual event messages to view details.
Note: The subscription streams for the duration specified in your Connection Settings & Parameters settings.
Publish with Kafka

To publish data with Kafka:

  • From the Operation menu, select Publish.
  • Click Body and paste your data into the Body field.
  • Click Publish.
Highlight search results