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
+44-1Lines changed: 44 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -28,9 +28,48 @@ The `PulsarNamespace` resource defines a namespace in a Pulsar cluster. It allow
28
28
|`replicationClusters`| List of clusters to which the namespace is replicated. Use only if replicating clusters within the same Pulsar instance. | No |
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
+
|`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 |
31
32
32
33
Note: Valid time units are "s" (seconds), "m" (minutes), "h" (hours), "d" (days), "w" (weeks).
33
34
35
+
## topicAutoCreationConfig
36
+
37
+
The `topicAutoCreationConfig` field allows you to control the automatic topic creation behavior at the namespace level:
|`allow`| Whether automatic topic creation is allowed in this namespace. | No |
42
+
|`type`| The type of topics to create automatically. Options: "partitioned", "non-partitioned". | No |
43
+
|`partitions`| The default number of partitions for automatically created topics when type is "partitioned". | No |
44
+
45
+
This configuration overrides the broker's default topic auto-creation settings for the specific namespace. When a client attempts to produce messages to or consume messages from a non-existent topic, the broker can automatically create that topic based on these settings.
46
+
47
+
### Configuration examples
48
+
49
+
1.**Enable auto-creation with partitioned topics**:
50
+
```yaml
51
+
topicAutoCreationConfig:
52
+
allow: true
53
+
type: "partitioned"
54
+
partitions: 8
55
+
```
56
+
This will automatically create partitioned topics with 8 partitions when clients attempt to use non-existent topics.
57
+
58
+
2. **Enable auto-creation with non-partitioned topics**:
59
+
```yaml
60
+
topicAutoCreationConfig:
61
+
allow: true
62
+
type: "non-partitioned"
63
+
```
64
+
This will automatically create non-partitioned topics when clients attempt to use non-existent topics.
65
+
66
+
3. **Disable auto-creation**:
67
+
```yaml
68
+
topicAutoCreationConfig:
69
+
allow: false
70
+
```
71
+
This explicitly disables topic auto-creation for the namespace, overriding any broker-level settings that might enable it.
72
+
34
73
## replicationClusters vs geoReplicationRefs
35
74
36
75
The `replicationClusters` and `geoReplicationRefs` fields serve different purposes in configuring replication for a Pulsar namespace:
@@ -74,6 +113,10 @@ spec:
74
113
# retentionTime: 20h
75
114
# retentionSize: 2Gi
76
115
# lifecyclePolicy: CleanUpAfterDeletion
116
+
# topicAutoCreationConfig:
117
+
# allow: true
118
+
# type: "partitioned"
119
+
# partitions: 4
77
120
```
78
121
79
122
2. Apply the YAML file to create the namespace.
@@ -101,7 +144,7 @@ Please note the following important points:
101
144
102
145
1. The fields `name` and `bundles` cannot be updated after the namespace is created. These are immutable properties of the namespace.
103
146
104
-
2. Other fields such as `backlogQuotaLimitSize`, `backlogQuotaLimitTime`, `messageTTL`, `maxProducersPerTopic`, `maxConsumersPerTopic`, `maxConsumersPerSubscription`, `retentionTime`, and `retentionSize` can be modified.
147
+
2. Other fields such as `backlogQuotaLimitSize`, `backlogQuotaLimitTime`, `messageTTL`, `maxProducersPerTopic`, `maxConsumersPerTopic`, `maxConsumersPerSubscription`, `retentionTime`, `retentionSize`, and `topicAutoCreationConfig` can be modified.
105
148
106
149
3. If you want to change the `connectionRef`, ensure that the new PulsarConnection resource exists and is properly configured. Changing the `connectionRef` can have significant implications:
0 commit comments