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.- Kafka cluster
- Pulsar cluster
- Cloud Console
The Schema Registry is served at the cluster’s HTTP service URL, with no sub-path:
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 theoauth-client dependency alongside your Kafka client
and serializer:
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.mTLS
When the cluster presents a TLS listener and mutual TLS is configured, the client certificate identifies the caller and theAuthorization 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:/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.