For AI agents: the complete documentation index is available at https://docs.ovhcloud.com/de/llms.txt, the full documentation bundle is available at https://docs.ovhcloud.com/de/llms-full.txt, and this page is available as Markdown at https://docs.ovhcloud.com/de/guides/public-cloud/data-analytics/analytics/kafka-enable-schema-registry.md.
Zum Inhalt springen

Kafka - How to enable the Schema Registry

Als Markdown ansehen

Find out how to enable the Schema Registry for your Kafka service and register your first schema

Objective

Apache Kafka is an open-source, distributed event streaming platform designed for real-time, large-scale data processing with high scalability, durability, and low latency.

The Schema Registry stores the schemas of your messages and lets producers and consumers agree on their format.

This guide explains how to enable the Schema Registry for your Kafka service from the OVHcloud Console or the OVHcloud API, and how to register a first schema.

Requirements


OVHcloud Console Access

  • Direct link:
  • Navigation path: Public Cloud > Select your project > Analytics

Instructions

Enabling the Schema Registry

OVHcloud Console
OVHcloud API

Go to the Configuration tab of your Kafka service. In the Kafka features section, turn on the Schema registry switch.

The Schema Registry can be disabled with the same switch.

Retrieving the Schema Registry endpoint

Once the Schema Registry is enabled, a kafkaSchemaRegistry endpoint is added to your service. You can find it in the endpoints list of the service details:

{
  "component": "kafkaSchemaRegistry",
  "domain": "kafka-xxxxxxxx-xxxxxxxxx.database.cloud.ovh.net",
  "port": 20189,
  "scheme": "https",
  "ssl": true,
  "uri": "https://<username>:<password>@kafka-xxxxxxxx-xxxxxxxxx.database.cloud.ovh.net:20189"
}

The Schema Registry uses HTTPS with the CA certificate of your service, and the username and password of a Kafka user.

Granting access to the Schema Registry

A user needs a Schema Registry ACL to read or register schemas. Without one, every request returns 401 Unauthorized.

For example, to let the user app-orders register schemas for the orders-value subject, create the following ACL:

{
  "username": "app-orders",
  "resource": "Subject:orders-value",
  "permission": "schema_registry_write"
}

See the ACL guide for the available permissions and resources.

Registering and listing schemas

Download the CA certificate of your service as ca.pem (see Connect to a Kafka cluster with CLI), then register an Avro schema for the orders-value subject:

curl --cacert ca.pem -u 'app-orders:<password>' \
  -H 'Content-Type: application/vnd.schemaregistry.v1+json' \
  -X POST https://<host>:<port>/subjects/orders-value/versions \
  -d '{"schema":"{\"type\":\"record\",\"name\":\"Order\",\"fields\":[{\"name\":\"amount\",\"type\":\"int\"}]}"}'

The Schema Registry returns the identifier of the schema:

{"id":1}

List the subjects the user can access:

curl --cacert ca.pem -u 'app-orders:<password>' https://<host>:<port>/subjects
["orders-value"]

We want your feedback!

We would love to help answer questions and appreciate any feedback you may have.

For training or technical assistance implementing our solutions, contact your sales representative or visit our Professional Services page to request a quote and have your project analysed by our experts.

Are you on Discord? Connect to our channel at https://discord.gg/ovhcloud and interact directly with the team that builds our Analytics service!

Join our community of users.

War diese Seite hilfreich?