How To Create A Kafka Schema#
Introduction#
Code#
In this guide, you will learn how to create a Kafka Avro Schema in the Hopsworks Schema Registry.
Step 1: Get the Kafka API#
Step 2: Define the schema#
Define the Avro Schema, see types for the format of the schema.
schema = {
"type": "record",
"name": "tutorial",
"fields": [
{"name": "id", "type": "int"},
{"name": "data", "type": "string"},
],
}
Step 3: Create the schema#
Create the schema in the Schema Registry.