-
Notifications
You must be signed in to change notification settings - Fork 50
Doc-1996: Schema Registry Contexts #1658
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 41 commits
3c19d16
51f0e5a
49a620c
0657a06
7566a77
24eb29d
b8de5b2
b7e87ea
1ac6b7e
d0c1357
c8d6312
c81afb0
c998717
8613e3c
d797a76
69243b9
b04e90e
a548896
88c76ad
e445bba
d493995
49e88e3
fbeee42
2f9d3df
304d7ee
915b5fe
b2a9211
9802088
c84400a
6cb5311
ffa12f5
14f8c6e
4e10c42
3d7c996
37869ad
fdd8cf8
aa094ce
ef3312c
22a29ca
3b24e2b
b0a986d
7750e03
ca943dc
d9c0cc7
1b8fc8f
aa90292
1a9c6c0
7012e14
118f48c
b3566dc
d06bdff
41aad7f
863ae9c
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -240,6 +240,49 @@ Curl:: | |
|
|
||
| When you register an evolved schema for an existing subject, the version `id` is incremented by 1. | ||
|
|
||
| == Use Schema Registry contexts | ||
|
|
||
| Starting in Redpanda v26.1, you can use contexts to create isolated namespaces for schemas, subjects, and configuration within a single Schema Registry instance. | ||
|
|
||
| ifndef::env-cloud[] | ||
| To use contexts, first set the `schema_registry_enable_qualified_subjects` cluster configuration property to `true`, then restart the broker. See xref:manage:schema-reg/schema-reg-contexts.adoc[] for setup instructions. | ||
| endif::env-cloud[] | ||
| ifdef::env-cloud[] | ||
| To use contexts on BYOC and Dedicated clusters, xref:manage:cluster-maintenance/config-cluster.adoc[configure the cluster property] `schema_registry_enable_qualified_subjects`. See xref:manage:schema-reg/schema-reg-contexts.adoc[] for details. | ||
| endif::env-cloud[] | ||
|
|
||
| Contexts are created implicitly when you register a schema using a context-qualified subject. For example, registering a schema with the subject `:.staging:sensor-value` creates the `.staging` context if it does not already exist: | ||
|
|
||
| [source,bash] | ||
| ---- | ||
| curl -s -X POST \ | ||
| http://localhost:8081/subjects/:.staging:sensor-value/versions \ | ||
| -H "Content-Type: application/vnd.schemaregistry.v1+json" \ | ||
| -d '{"schema": "{\"type\":\"string\"}"}' | ||
| ---- | ||
|
|
||
| === Scope API operations to a context | ||
|
|
||
|
Feediver1 marked this conversation as resolved.
Outdated
|
||
| You can scope any Schema Registry API operation to a specific context in two ways: | ||
|
|
||
| * Qualified subjects: Use the `:<context>:<subject>` syntax wherever a subject is accepted. For example, to list subjects in the `.staging` context: | ||
| + | ||
| [source,bash] | ||
| ---- | ||
| curl -s "http://localhost:8081/subjects?subjectPrefix=:.staging:" | ||
| ---- | ||
|
|
||
| * Base URL prefix: Prefix any endpoint path with `/contexts/{context}/`. The server rewrites the request to operate within that context. This approach is recommended for non-Java SerDe clients that do not support qualified subject syntax: | ||
| + | ||
| [source,bash] | ||
| ---- | ||
| curl -s http://localhost:8081/contexts/.staging/subjects | ||
| ---- | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is still WIP, as per https://github.com/redpanda-data/docs/pull/1658/changes#r3123466186
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. So remove the entire point about the base URL prefix?
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @trevpanda @mattschumpert what do you think? We need to either remove it or call out that it's not yet supported. But from slack I vaguely recall a policy that we don't document future features, so I am leaning removing this for now, yes. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, we should remove until we support
Feediver1 marked this conversation as resolved.
Outdated
|
||
|
|
||
| Unqualified subjects continue to work and operate in the default context. | ||
|
|
||
| For the complete endpoint reference, see the link:/api/doc/schema-registry/[Schema Registry API reference]. | ||
|
Feediver1 marked this conversation as resolved.
Outdated
|
||
|
|
||
| == Retrieve a schema | ||
|
|
||
| To retrieve a registered schema from the registry, make a GET request to the `/schemas/ids/\{id}` endpoint: | ||
|
|
@@ -1188,6 +1231,7 @@ endif::[] | |
| == Suggested reading | ||
| ifndef::env-cloud[] | ||
| * xref:manage:schema-reg/schema-reg-overview.adoc[] | ||
| * xref:manage:schema-reg/schema-reg-contexts.adoc[] | ||
| * xref:reference:rpk/rpk-registry/rpk-registry.adoc[rpk registry] | ||
| * link:/api/doc/schema-registry/[Schema Registry API] | ||
| * xref:reference:node-configuration-sample.adoc[] (search for `schema_registry`) | ||
|
|
@@ -1197,6 +1241,7 @@ ifndef::env-cloud[] | |
| endif::[] | ||
| ifdef::env-cloud[] | ||
| * xref:manage:schema-reg/schema-reg-overview.adoc[] | ||
| * xref:manage:schema-reg/schema-reg-contexts.adoc[] | ||
| * xref:reference:rpk/rpk-registry/rpk-registry.adoc[rpk registry] | ||
| * link:/api/doc/schema-registry/[Schema Registry API] | ||
| * xref:manage:monitoring.adoc#service-level-queries[Monitor Schema Registry service-level metrics] | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.