Skip to main content
To use the Kafka Schema Registry you need three things: its URL, credentials, and permission on the subjects your application touches.

Prerequisites

  • A Kafka cluster, or a Pulsar cluster with the Kafka protocol enabled, on StreamNative Cloud.
  • A service account with an API key. See Create an API key.
  • Schema Registry permissions for that service account, granted through role-based access control (RBAC). See Grant access.

Get the Schema Registry URL

The URL depends on the cluster type.
The Schema Registry is served at the cluster’s HTTP service URL, with no sub-path:
The /kafka sub-path applies only to Pulsar clusters. A URL copied from one cluster type won’t work on the other.
The registry listens on port 443 over HTTPS. See Networking for all cluster endpoints and ports.

Authenticate

Three mechanisms are available.

Basic authentication

Works with every Kafka client. Supply your API key as the password; the username can be any non-empty string.
Only the password is used as the credential. The username is ignored, so pass any non-empty placeholder.

OAuth2

Available for the Kafka Java client. Add the oauth-client dependency alongside your Kafka client and serializer:
Minimum versions: kafka-clients 3.4.0, oauth-client 3.1.0.4, kafka-avro-serializer 7.5.0.
Before version 3.2.2.6, oauth-client requires Java 17 or later.
On top of the properties that already configure OAuth2 for the Kafka connection, add:
See Configure Kafka clients with OAuth 2.0 for the Kafka-connection half of the configuration.

mTLS

When the cluster presents a TLS listener and mutual TLS is configured, the client certificate identifies the caller and the Authorization header is ignored.

Grant access

Assign one of the Schema Registry roles, scoped to the subjects the client uses: A producer that registers schemas needs schema-writer; a consumer that only resolves them needs schema-reader. See Manage RBAC roles for how to bind a role to a service account.
Some Pulsar clusters authorize Schema Registry access through a single ACL on the registry’s backing topic instead of RBAC. See Kafka Schema Registry on Pulsar clusters.

Verify the connection

List the schema formats the registry supports. A successful response confirms the URL and your credentials:
Then list the subjects registered on the cluster:
/subjects returns only the subjects your credentials can read, rather than failing with a permission error. An empty array can mean the registry is empty or that your role doesn’t cover any existing subject.

Next steps

Confluent compatibility

Which endpoints work, which don’t, and where behavior differs.

Schema ID validation

Make the broker reject records without a registered schema ID.