Consuming Kafka APIs (Beta)

You can search for Kafka APIs just like other APIs on the API Hub. After clicking on a Kafka API, you will see the Kafka API playground.

1487

Exploring topics

On the Kafka API playground, you can search for topics by name.

To view a topic's configuration, click the Configuration tab.

616

To understand the schema for a topic (if a schema registry is configured by the provider), click the Schema tab. You can view the schemas for both the key and the value here.

605

Viewing records

To view records from a selected topic, click View Records. The default option is to consume records from the beginning, but you can configure this to view records from the latest offset or records produced after a time you specify. You can also specify a partition to read records from.

618

You can even specify the maximum number of records to view. The maximum value allowed is 100 records, which is also the default.

616

The connection stays live and any new records produced are displayed until 100 records have been displayed or two minutes have passed since clicking View Records. After this, the stream is automatically stopped. You can also stop or pause the stream at any time.

1424

You can view records in a table or in raw format. A search function allows you to view records with content matching your search term, which can be useful for debugging.

1420 1424

Producing records

Click on the produce tab and enter the key and value for a record you want to produce. The schema tab gives you quick reference to ensure your record matches the set schema in the schema registry. If no schema registry has been configured, the key or value text is interpreted as a string.

1417

You can optionally add one or more headers by clicking on the Headers tab.

1418

Further, you can force the record to be sent to a specific partition.

1409

And you can select a compression type to be used.

1416

To view the produced records, click Consume and then View Records. If you already have a View Records session for that topic running, you will see the records you produce from the Produce tab.


What’s Next

Learn more about adding Kafka APIs (private to your account, shared with just your team or multiple teams in your organization, or shared publicly).