Skip to main content
Manage schemas in the Pulsar Schema Registry with pulsarctl, the Pulsar admin REST API, or the PulsarAdmin Java client.

Prerequisites

  • A Pulsar cluster on StreamNative Cloud.
  • An API key or OAuth credentials for a service account with admin access to the target tenant and namespace. See Service accounts.
  • pulsarctl installed and configured, if you use the CLI.
The examples below use pulsarctl. The equivalent pulsar-admin commands take the same subcommands and arguments—pass --admin-url, --auth-plugin org.apache.pulsar.client.impl.auth.AuthenticationToken, and --auth-params token:<API Key> to point it at your cluster.

Upload a schema

To register a new schema for a topic:
The schema definition file and the REST payload use the same JSON format:
Here’s a complete JSON schema example:

Get a schema

Get the latest version

Example output:

Get a specific version

Delete a schema

Deleting a schema removes all versions registered for the topic. There’s no per-version delete and no way to recover the versions afterward.

Set the compatibility strategy

The compatibility strategy can be configured at the topic and namespace levels, and the topic level wins. If you set it at both, the topic-level value applies.
Pulsar also supports a cluster-level default through broker configuration. On StreamNative Cloud that default is managed for you—set the strategy at the topic or namespace level instead.

Topic level

Namespace level

To read the current value back, use the matching get-schema-compatibility-strategy subcommand at either level.

Manage AutoUpdate

AutoUpdate is enabled by default. It’s a namespace-level policy.
Disable it when you want schemas registered only through an explicit upload—for example, when schema changes go through a review process rather than being registered by whichever producer connects first.

Manage schema validation

Schema validation enforcement is disabled for producers by default, which means a producer carrying no schema can write raw bytes to a topic that has one. Enable it to reject those producers. It’s a namespace-level policy.

Create a schema in the Cloud Console

You can also attach a schema to a topic when you create it in the StreamNative Cloud Console. See Create schema for topics.

What’s next

Compatibility

Choose the right strategy before you change a schema.

Use with clients

Produce and consume typed messages.
Parts of this page are adapted from the Apache Pulsar documentation, licensed under the Apache License 2.0.