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.
pulsarctlinstalled 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:- pulsarctl
- REST API
- Java
Here’s a complete JSON schema example:
Get a schema
Get the latest version
- pulsarctl
- REST API
- Java
Get a specific version
- pulsarctl
- REST API
- Java
Delete a schema
- pulsarctl
- REST API
- Java
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
- pulsarctl
- Java
Namespace level
- pulsarctl
- Java
get-schema-compatibility-strategy subcommand at
either level.
Manage AutoUpdate
AutoUpdate is enabled by default. It’s a namespace-level policy.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.