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
Copy file name to clipboardExpand all lines: docs/pulsar_namespace.md
+19-17Lines changed: 19 additions & 17 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -29,7 +29,7 @@ The `PulsarNamespace` resource defines a namespace in a Pulsar cluster. It allow
29
29
|`deduplication`| Whether to enable message deduplication for the namespace. | No |
30
30
|`bookieAffinityGroup`| Set the bookie-affinity group for the namespace, which has two sub fields: `bookkeeperAffinityGroupPrimary(String)` is required, and `bookkeeperAffinityGroupSecondary(String)` is optional. | No |
31
31
|`topicAutoCreationConfig`| Configures automatic topic creation behavior within this namespace. Contains settings for whether auto-creation is allowed, the type of topics created, and default number of partitions. | No |
32
-
|`schemaCompatibilityStrategy`| Schema compatibility strategy for this namespace. Controls how schema evolution is handled for topics within this namespace. Options: `AutoUpdateDisabled`, `Backward`, `Forward`, `Full`, `AlwaysCompatible`, `BackwardTransitive`, `ForwardTransitive`, `FullTransitive`. | No |
32
+
|`schemaCompatibilityStrategy`| Schema compatibility strategy for this namespace. Controls how schema evolution is handled for topics within this namespace. Options: `UNDEFINED`, `ALWAYS_INCOMPATIBLE`, `ALWAYS_COMPATIBLE`, `BACKWARD`, `FORWARD`, `FULL`, `BACKWARD_TRANSITIVE`, `FORWARD_TRANSITIVE`, `FULL_TRANSITIVE`. | No |
33
33
|`schemaValidationEnforced`| Controls whether schema validation is enforced for this namespace. When enabled, producers must provide a schema when publishing messages. If not specified, the cluster's default schema validation enforcement setting will be used. | No |
34
34
35
35
Note: Valid time units are "s" (seconds), "m" (minutes), "h" (hours), "d" (days), "w" (weeks).
@@ -82,37 +82,39 @@ The `schemaCompatibilityStrategy` field controls how Pulsar handles schema evolu
82
82
83
83
#### Available Strategies
84
84
85
-
1. **AutoUpdateDisabled**: Disables automatic schema updates and requires manual schema management. This is the most restrictive strategy, suitable for ultra-stable environments where strict schema control is required and no automatic schema evolution is desired.
85
+
1. **UNDEFINED**: Uses the cluster's default schema compatibility strategy. When this value is set, the namespace inherits the schema compatibility settings from the Pulsar cluster configuration. This is useful when you want to maintain consistency with cluster-wide policies.
86
86
87
-
2. **AlwaysCompatible**: Allows any schema changes without validation. This is the most permissive strategy but may lead to compatibility issues. Suitable for development/testing environments.
87
+
2. **ALWAYS_INCOMPATIBLE**: Disallows any schema changes. This is the most restrictive strategy, suitable for ultra-stable environments where no schema evolution is desired and strict schema immutability is required.
88
88
89
-
3. **Backward**: New schema can read data written with the previous schema. This strategy supports consumer-driven schema evolution, such as adding optional fields or removing fields.
89
+
3. **ALWAYS_COMPATIBLE**: Allows any schema changes without validation. This is the most permissive strategy but may lead to compatibility issues. Suitable for development/testing environments where rapid iteration is needed.
90
90
91
-
4. **BackwardTransitive**: New schema can read data written with any previous schema in the chain. This provides long-term backward compatibility across multiple schema versions.
91
+
4. **BACKWARD**: New schema can read data written with the previous schema. This strategy supports consumer-driven schema evolution, such as adding optional fields or removing fields. Consumers with new schemas can process data from producers with older schemas.
92
92
93
-
5. **Forward**: Previous schema can read data written with the new schema. This strategy supports producer-driven schema evolution, such as adding fields that older consumers can ignore.
93
+
5. **FORWARD**: Previous schema can read data written with the new schema. This strategy supports producer-driven schema evolution, such as adding fields that older consumers can ignore. Consumers with older schemas can still process data from producers with newer schemas.
94
94
95
-
6. **ForwardTransitive**: Any previous schema can read data written with the new schema. This ensures new data is readable by any older schema version.
95
+
6. **FULL**: Schema changes are both forward and backward compatible. Both new and previous schemas can read data written by either schema. This provides strict compatibility requirements in both directions and is suitable for environments requiring maximum interoperability.
96
96
97
-
7. **Full**: Schema changes are both forward and backward compatible. Both new and previous schemas can read data written by either schema. This provides strict compatibility requirements in both directions.
97
+
7. **BACKWARD_TRANSITIVE**: New schema can read data written with any previous schema in the chain. This provides long-term backward compatibility across multiple schema versions, ensuring consumers can always read historical data regardless of schema evolution.
98
98
99
-
8. **FullTransitive**: Schema changes are forward and backward compatible with all schemas. Any schema in the chain can read data written by any other schema in the chain. This provides maximum compatibility guarantees.
99
+
8. **FORWARD_TRANSITIVE**: Any previous schema can read data written with the new schema. This ensures new data is readable by any older schema version, providing comprehensive forward compatibility across the entire schema evolution chain.
100
+
101
+
9. **FULL_TRANSITIVE**: Schema changes are forward and backward compatible with all schemas. Any schema in the chain can read data written by any other schema in the chain. This provides maximum compatibility guarantees across all schema versions.
100
102
101
103
#### Usage Examples
102
104
103
105
**Development Environment**:
104
106
```yaml
105
-
schemaCompatibilityStrategy: AlwaysCompatible
107
+
schemaCompatibilityStrategy: ALWAYS_COMPATIBLE
106
108
```
107
109
108
110
**Production Environment**:
109
111
```yaml
110
-
schemaCompatibilityStrategy: Backward
112
+
schemaCompatibilityStrategy: BACKWARD
111
113
```
112
114
113
115
**Critical Systems**:
114
116
```yaml
115
-
schemaCompatibilityStrategy: FullTransitive
117
+
schemaCompatibilityStrategy: FULL_TRANSITIVE
116
118
```
117
119
118
120
### Schema Validation Enforcement
@@ -129,28 +131,28 @@ The `schemaValidationEnforced` field controls whether producers must provide a s
129
131
130
132
#### Development/Testing Environment
131
133
```yaml
132
-
schemaCompatibilityStrategy: AlwaysCompatible
134
+
schemaCompatibilityStrategy: ALWAYS_COMPATIBLE
133
135
schemaValidationEnforced: false
134
136
```
135
137
This configuration allows rapid schema iteration and flexible schema validation for experimentation.
136
138
137
139
#### Standard Production Environment
138
140
```yaml
139
-
schemaCompatibilityStrategy: Backward
141
+
schemaCompatibilityStrategy: BACKWARD
140
142
schemaValidationEnforced: true
141
143
```
142
144
This provides a good balance between flexibility and safety, ensuring consumers can handle schema changes while enforcing schema validation for data consistency.
143
145
144
146
#### Mission-Critical Systems
145
147
```yaml
146
-
schemaCompatibilityStrategy: FullTransitive
148
+
schemaCompatibilityStrategy: FULL_TRANSITIVE
147
149
schemaValidationEnforced: true
148
150
```
149
151
This configuration provides maximum compatibility guarantees with strict schema validation enforcement.
150
152
151
153
#### Legacy System Integration
152
154
```yaml
153
-
schemaCompatibilityStrategy: ForwardTransitive
155
+
schemaCompatibilityStrategy: FORWARD_TRANSITIVE
154
156
schemaValidationEnforced: false
155
157
```
156
158
This ensures older systems can consume new data while allowing gradual migration without strict schema requirements.
Copy file name to clipboardExpand all lines: docs/pulsar_topic.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -151,7 +151,7 @@ The `schemaInfo` field has the following structure:
151
151
| Field | Description | Required |
152
152
|-------|-------------|----------|
153
153
|`type`| The schema type, which determines how to interpret the schema data. | Yes |
154
-
|`schema`| The schema definition, which is a base64 encoded string representing the schema. | Yes |
154
+
|`schema`| The schema definition. For AVRO and JSON schemas, this should be a JSON string of the schema definition. For PROTOBUF_NATIVE schemas, this should be the JSON string of protobuf definition string from [ProtobufNativeSchemaData](https://github.com/apache/pulsar/blob/master/pulsar-common/src/main/java/org/apache/pulsar/common/protocol/schema/ProtobufNativeSchemaData.java). | Yes |
155
155
|`properties`| A map of user-defined properties as key-value pairs. Applications can use this for carrying any application-specific logic. | No |
0 commit comments