You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
:learning-objective-1: Understand what Schema Registry contexts are and when to use them.
6
-
:learning-objective-2: Understand the qualified subject syntax (:<context>:<subject>).
6
+
:learning-objective-2: Understand the qualified subject syntax (`:<context>:<subject>`).
7
7
:learning-objective-3: Enable the feature using the cluster configuration property (requires broker restart), and configuring contexts, including per-context mode and compatibility settings.
8
8
:learning-objective-4: Apply ACLs to control access at the context level.
9
9
:learning-objective-5: Identify updated metrics and the new cluster configuration property.
@@ -22,7 +22,6 @@ After reading this page, you will be able to:
22
22
* [ ] {learning-objective-4}
23
23
* [ ] {learning-objective-5}
24
24
* [ ] {learning-objective-6}
25
-
* [ ]
26
25
27
26
Schema Registry contexts are namespaces that isolate schemas, subjects, and configurations from one another within a single Schema Registry instance.
28
27
Each context maintains its own schema ID counter, mode settings, and compatibility settings.
@@ -69,12 +68,13 @@ The `schema_registry_enable_qualified_subjects` property defaults to `false`, so
69
68
70
69
71
70
== How Schema Registry contexts work
71
+
When you enable contexts, Schema Registry changes how it assigns schema IDs, resolves configuration, and interprets subject names.
72
72
73
73
=== Schema ID isolation
74
74
75
-
Before contexts, the Schema Registry maintained a single global ID counter. All schemas shared one ID space, and a given schema ID pointed to exactly one schema across the entire registry.
75
+
Prior to v26.1, the Schema Registry maintained a single global ID counter. All schemas shared one ID space, and a given schema ID pointed to exactly one schema across the entire registry.
76
76
77
-
After enabling contexts, each context has its own independent ID counter. This means schema ID `1` in `.staging` and schema ID `1` in `.production` are different schemas. As a result (and by default), `GET /schemas/ids/{id}` searches the _default context only_. To retrieve a schema by ID from a non-default context, you must pass the `subject` query parameter to scope the lookup:
77
+
With Schema Registry contexts, each context has its own independent ID counter. This means schema ID `1` in `.staging` and schema ID `1` in `.production` are different schemas. As a result (and by default), `GET /schemas/ids/{id}` searches the _default context only_. To retrieve a schema by ID from a non-default context, you must pass the `subject` query parameter to scope the lookup:
78
78
79
79
[source,bash]
80
80
----
@@ -85,7 +85,7 @@ See also <<schema-id-lookup-fails>>.
85
85
86
86
=== Configuration resolution order
87
87
88
-
Before contexts, mode and compatibility settings resolved as:
88
+
Prior to v26.1, mode and compatibility settings resolved as:
89
89
90
90
----
91
91
Subject → Global → Built-in defaults
@@ -128,7 +128,7 @@ Wherever the Schema Registry API accepts a subject, you can supply a qualified s
128
128
129
129
=== `GET /subjects` behavior change
130
130
131
-
After enabling the flag, `GET /subjects` (with no `subjectPrefix`) returns subjects across *all* contexts. Non-default context subjects appear with their qualified names — for example, `:.staging:my-topic`. This is a behavioral change from the previous flat list of bare subject names.
131
+
After enabling the flag, `GET /subjects` (with no `subjectPrefix`) returns subjects across _all_ contexts. Non-default context subjects appear with their qualified names (for example, `:.staging:my-topic`). Note that this is differs from the previous flat lists of bare subject names.
132
132
133
133
=== Cross-context schema references
134
134
@@ -137,7 +137,7 @@ Contexts do not enforce isolation of schema references. Schemas can reference sc
137
137
== Enable Schema Registry contexts
138
138
139
139
ifndef::env-cloud[]
140
-
To enable contexts on a self-managed cluster, set the `schema_registry_enable_qualified_subjects` cluster configuration property to `true`:
140
+
To enable contexts, set the `schema_registry_enable_qualified_subjects` cluster configuration property to `true`:
141
141
142
142
[source,bash]
143
143
----
@@ -165,6 +165,7 @@ endif::env-cloud[]
165
165
166
166
=== Register a schema in a context
167
167
168
+
The following configuration examples show how to perform common context operations using the Schema Registry HTTP API and qualified subject syntax.
168
169
To register a schema in a named context, use the qualified subject form in the `POST /subjects/{subject}/versions` request:
169
170
170
171
[source,bash]
@@ -341,7 +342,7 @@ Unqualified references in schema definitions resolve to the same context as the
341
342
342
343
=== Delete a context
343
344
344
-
A context can only be deleted when it contains no subjects. Soft-deleted subjects still count — you must hard-delete all subjects before the context can be removed. Attempting to delete a non-empty context returns a `context_not_empty` error.
345
+
You can only delete a context when it contains no subjects. Soft-deleted subjects still count; however, you must hard-delete all subjects before removing the context. Attempting to delete a non-empty context returns a `context_not_empty` error.
Native `rpk` commands for context management operations (listing, creating, and deleting contexts) are not yet available. Use the Schema Registry HTTP API directly for context-level operations. See <<client-integration-status>>.
366
+
Native `rpk` commands for context management operations (listing, creating, and deleting contexts) are not available. Use the Schema Registry HTTP API for context-level operations. See <<client-integration-status>>.
366
367
====
367
368
368
369
Existing `rpk registry` commands that accept a subject name support qualified subject syntax once `schema_registry_enable_qualified_subjects` is enabled. Pass a qualified subject wherever a `--subject` flag is accepted:
@@ -422,7 +423,7 @@ rpk security acl create \
422
423
--allow-principal User:alice
423
424
----
424
425
425
-
For full reference documentation on these commands, see:
426
+
For additional detail, refer to the full reference documentation for these commands:
@@ -437,42 +438,43 @@ For full reference documentation on these commands, see:
437
438
438
439
== Client integration status
439
440
441
+
The following table identifies the support level of Schema Registry context client integrations.
440
442
[#client-integration-status]
441
443
442
444
[cols="2,1,3", options="header"]
443
445
|===
444
446
| Client | Status | Notes
445
447
446
448
| Schema Registry API (all operations)
447
-
| Full support
449
+
| Supported
448
450
| Use qualified subjects directly in any endpoint.
449
451
450
452
| Java SerDe (Confluent)
451
453
| Supported
452
454
| Requires a custom `ContextNameStrategy`. See the Confluent SerDe documentation for details.
453
455
454
456
| Non-Java SerDe
455
-
| Not yet supported (26.1)
456
-
| Planned in a 26.1.x patch release. Workaround: set the client's Schema Registry base URL to `http://<host>:8081/contexts/{context}`.
457
+
| Not supported
458
+
| Workaround: set the client's Schema Registry base URL to `http://<host>:8081/contexts/{context}`.
457
459
458
460
| rpk
459
-
| In progress
460
-
| Context management commands not yet available. Qualified subjects work in existing `rpk registry` commands.
461
+
| Not supported
462
+
| Context management commands not available. Qualified subjects work in existing `rpk registry` commands.
461
463
462
464
| Redpanda Console
463
-
| In progress
464
-
| Not available in 26.1.
465
+
| Not supported
466
+
|
465
467
466
468
| Server-side schema ID validation
467
469
| Not supported
468
-
| Out of scope for this release.
470
+
|
469
471
|===
470
472
471
473
== ACL authorization
472
474
473
475
[#acl-authorization]
474
476
475
-
Contexts use the existing `sr_subject` and `sr_registry` ACL resource types. No new resource types are needed.
477
+
Contexts use the existing `sr_subject` and `sr_registry` ACL resource types.
476
478
477
479
[cols="2,2,2", options="header"]
478
480
|===
@@ -519,7 +521,7 @@ rpk security acl create \
519
521
520
522
=== Audit log format
521
523
522
-
When Schema Registry ACLs are enabled, audit log entries include the fully qualified subject name for non-default context operations:
524
+
When you enable Schema Registry ACLs, audit log entries include the fully qualified subject name for non-default context operations:
523
525
524
526
[source,json]
525
527
----
@@ -533,11 +535,11 @@ When Schema Registry ACLs are enabled, audit log entries include the fully quali
533
535
}
534
536
----
535
537
536
-
Default context subjects are logged with their unqualified name (no change from existing behavior).
538
+
Default context subjects are logged with their unqualified name.
537
539
538
540
== Metrics
539
541
540
-
The following Schema Registry metrics have been updated to include a `context` label, enabling per-context monitoring:
542
+
The following Schema Registry metrics include a `context` label, enabling per-context monitoring:
541
543
542
544
[cols="2,2", options="header"]
543
545
|===
@@ -565,12 +567,12 @@ endif::env-cloud[]
565
567
566
568
[IMPORTANT]
567
569
====
568
-
*Breaking change*: When `schema_registry_enable_qualified_subjects` is enabled, any existing subject whose name matches the qualified subject pattern — for example, `:.staging:user-value` — is reinterpreted as subject `user-value` in context `.staging`, rather than as a literal subject name in the default context. Subjects without a `:.` prefix are unaffected.
570
+
*Breaking change*: When `schema_registry_enable_qualified_subjects` is enabled, any existing subject whose name matches the qualified subject pattern (for example, `:.staging:user-value`) is reinterpreted as subject `user-value` in context `.staging`, rather than as a literal subject name in the default context. Subjects without a `:.` prefix are unaffected.
569
571
570
-
This edge case is expected to be rare. No automatic migration is provided.
572
+
This edge case is rare. No automatic migration is provided.
571
573
====
572
574
573
-
To audit your existing subjects for affected names before enabling the feature:
575
+
To audit your existing subjects for affected names before enabling Schema Registry contexts:
If affected subjects are found, rename them before enabling the property, or plan to re-register them under the reinterpreted context structure after enabling.
591
+
If you find affected subjects, rename them before enabling the property, or plan to re-register them under the reinterpreted context structure after enabling.
590
592
591
593
592
594
[IMPORTANT]
@@ -596,6 +598,7 @@ Remember that changing `schema_registry_enable_qualified_subjects` requires a br
596
598
597
599
== Troubleshooting
598
600
601
+
Following is troubleshooting guidance for Schema Registry contexts.
*Symptom*: Subjects with the `:.` prefix are stored as literal subject names in the default context instead of being parsed as context-qualified subjects.
616
619
617
-
*Cause 1*: `schema_registry_enable_qualified_subjects` is set to `false` (the 26.1 default for self-managed clusters).
620
+
*Cause 1*: `schema_registry_enable_qualified_subjects` is set to `false` (the default).
618
621
619
622
*Cause 2*: The property was set to `true` but the brokers have not yet been restarted. This property is not dynamic and requires a full broker restart to take effect.
620
623
@@ -628,7 +631,7 @@ rpk cluster config set schema_registry_enable_qualified_subjects true
628
631
----
629
632
endif::env-cloud[]
630
633
631
-
=== Schema registration fails after upgrading to 26.1
634
+
=== Schema registration fails after upgrading to v26.1
632
635
633
636
*Symptom*: A `POST /subjects/{subject}/versions` request returns an unexpected error after upgrading and enabling the flag.
0 commit comments