Skip to content

Commit 7348e97

Browse files
committed
Enhance GetTopicsOfNamespace with customizable topic listing using properties
1 parent b72c520 commit 7348e97

1 file changed

Lines changed: 25 additions & 4 deletions

File tree

pip/pip-452.md

Lines changed: 25 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,11 @@ We will modify the Pulsar Protocol to carry a properties map. On the Broker side
2323
The default implementation will preserve the existing behavior (fetching from ZooKeeper). The Broker's connection handler will simply delegate the request to this strategy.
2424

2525
# Detailed Design
26-
1. Protocol Changes
27-
We update `PulsarApi.proto` to include the properties field.
26+
27+
## Public-facing Changes
28+
29+
### Protocol Changes
30+
Update `PulsarApi.proto` to include the properties field.
2831

2932
PulsarApi.proto
3033
```protobuf
@@ -41,7 +44,23 @@ message CommandGetTopicsOfNamespace {
4144
repeated KeyValue properties = 6;
4245
}
4346
```
44-
2. Broker Changes
47+
48+
### REST API & CLI Changes
49+
50+
Add `properties` parameter to the REST API endpoint for listing topics in a namespace to list topic with specific properties for customizable topic listing.
51+
52+
REST API:
53+
```
54+
GET /admin/v2/persistent/{tenant}/{namespace} with a query params properties=k1=v1,k2=v2
55+
```
56+
57+
CLI:
58+
```
59+
pulsar-admin topics list <tenant>/<namespace> -p k1=v1 -p k2=v2"
60+
```
61+
62+
## Design & Implementation Details
63+
### Broker Changes
4564

4665
Add `TopicListingResult` for listing topic results
4766

@@ -239,7 +258,7 @@ private void internalHandleGetTopicsOfNamespace(String namespace, NamespaceName
239258
}
240259
```
241260

242-
3. Client Changes
261+
### Client Changes
243262
Update LookupService
244263
The internal LookupService interface is updated to accept the properties map.
245264

@@ -269,6 +288,8 @@ lookup.getTopicsUnderNamespace(
269288
// ... update subscriptions ...
270289
});
271290
```
291+
292+
272293
# Backward Compatibility
273294
Protocol: Adding an optional field (properties) to the Protobuf definition is non-breaking. Old clients will not send this field; old brokers will ignore it.
274295

0 commit comments

Comments
 (0)