Avro and schema ΒΆ

This guide will show you how to do various schema operations on your Kafka topics.

Note

The easiest way to communicate with the API is to use curl from one of your Kafka-pods, so that you have easy access to both the schema registry URL and the username/password.

Register schema ΒΆ

To register the first version of a schema under the subject "team.test-key" using Avro schema:

Plaintext

To register a version of a schema using JSON Schema, one needs to use schemaType property:

Plaintext

List versions of a schema ΒΆ

To list all the versions of a given schema (including the one just created above):

Plaintext

Fetch specific version of a schema ΒΆ

To get the specific version 1 of the schema just registered run:

Plaintext

Delete schema ΒΆ

In order to delete version 10 of the schema registered under subject "team.test-key" (if it exists):

Plaintext

To delete all versions of the schema registered under subject "team.test-key":

Plaintext

REST API ΒΆ

For applications that can't use Kafka directly, a REST API is possible. Because of security implications, we have not enabled the REST API on the cluster, but interested parties may run their own instance.

We have packaged Aivens Karapace project in a Nais-friendly package. Teams can install Karapace in their own namespace with relevant access to provide a REST API for Kafka topics. Check the Karapace Readme for details.