You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by "coderzc (via GitHub)" <gi...@apache.org> on 2026/01/18 12:15:42 UTC
[PR] Implement PIP-452 [pulsar]
coderzc opened a new pull request, #25160:
URL: https://github.com/apache/pulsar/pull/25160
PIP: https://github.com/apache/pulsar/pull/25134
<!-- Details of when a PIP is required and how the PIP process work, please see: https://github.com/apache/pulsar/blob/master/pip/README.md -->
### Motivation
<!-- Explain here the context, and why you're making that change. What is the problem you're trying to solve. -->
### Modifications
<!-- Describe the modifications you've done. -->
### Verifying this change
- [ ] Make sure that the change passes the CI checks.
*(Please pick either of the following options)*
This change is a trivial rework / code cleanup without any test coverage.
*(or)*
This change is already covered by existing tests, such as *(please describe tests)*.
*(or)*
This change added tests and can be verified as follows:
*(example:)*
- *Added integration tests for end-to-end deployment with large payloads (10MB)*
- *Extended integration test for recovery after broker failure*
### Does this pull request potentially affect one of the following parts:
<!-- DO NOT REMOVE THIS SECTION. CHECK THE PROPER BOX ONLY. -->
*If the box was checked, please highlight the changes*
- [ ] Dependencies (add or upgrade a dependency)
- [ ] The public API
- [ ] The schema
- [ ] The default values of configurations
- [ ] The threading model
- [ ] The binary protocol
- [ ] The REST endpoints
- [ ] The admin CLI options
- [ ] The metrics
- [ ] Anything that affects deployment
### Documentation
<!-- DO NOT REMOVE THIS SECTION. CHECK THE PROPER BOX ONLY. -->
- [ ] `doc` <!-- Your PR contains doc changes. -->
- [ ] `doc-required` <!-- Your PR changes impact docs and you will update later -->
- [x] `doc-not-needed` <!-- Your PR changes do not impact docs -->
- [ ] `doc-complete` <!-- Docs have been already added -->
### Matching PR in forked repository
PR in forked repository: <!-- ENTER URL HERE -->
<!--
After opening this PR, the build in apache/pulsar will fail and instructions will
be provided for opening a PR in the PR author's forked repository.
apache/pulsar pull requests should be first tested in your own fork since the
apache/pulsar CI based on GitHub Actions has constrained resources and quota.
GitHub Actions provides separate quota for pull requests that are executed in
a forked repository.
The tests will be run in the forked repository until all PR review comments have
been handled, the tests pass and the PR is approved by a reviewer.
-->
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [feat][broker] PIP-452: Customizable topic listing of namespace with properties [pulsar]
Posted by "coderzc (via GitHub)" <gi...@apache.org>.
coderzc commented on code in PR #25160:
URL: https://github.com/apache/pulsar/pull/25160#discussion_r2791191290
##########
pulsar-broker-common/src/main/java/org/apache/pulsar/broker/ServiceConfiguration.java:
##########
@@ -1269,6 +1279,14 @@ The max allowed delay for delayed delivery (in milliseconds). If the broker rece
)
private boolean enableBrokerSideSubscriptionPatternEvaluation = true;
+ @FieldContext(
+ dynamic = false,
+ category = CATEGORY_POLICIES,
+ doc = "Enables watching topic add/remove events on broker side for "
+ + "subscription pattern evaluation."
+ )
+ private boolean enableBrokerTopicListWatcher = true;
Review Comment:
The previous `enableSubscriptionPatternEvaluation` configuration had unclear responsibilities, as it included the following two functions simultaneously:
1. Enable regular expression filtering on the server side
2. Enable Topic List Watch
I separated it into two configurations (enableSubscriptionPatternEvaluation and enableBrokerTopicListWatcher), so that we can use enableSubscriptionPatternEvaluation to enable the server-side regular expression filtering function.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [feat][broker] PIP-452: Customizable topic listing of namespace with properties [pulsar]
Posted by "coderzc (via GitHub)" <gi...@apache.org>.
coderzc commented on code in PR #25160:
URL: https://github.com/apache/pulsar/pull/25160#discussion_r2791191290
##########
pulsar-broker-common/src/main/java/org/apache/pulsar/broker/ServiceConfiguration.java:
##########
@@ -1269,6 +1279,14 @@ The max allowed delay for delayed delivery (in milliseconds). If the broker rece
)
private boolean enableBrokerSideSubscriptionPatternEvaluation = true;
+ @FieldContext(
+ dynamic = false,
+ category = CATEGORY_POLICIES,
+ doc = "Enables watching topic add/remove events on broker side for "
+ + "subscription pattern evaluation."
+ )
+ private boolean enableBrokerTopicListWatcher = true;
Review Comment:
The previous `enableSubscriptionPatternEvaluation` configuration had unclear responsibilities, as it included the following two functions simultaneously:
1. Enable regular expression filtering on the server side
2. Enable Topic List Watch
I separated it into two configurations (enableSubscriptionPatternEvaluation and enableBrokerTopicListWatcher), so that we can still use `enableSubscriptionPatternEvaluation` to enable the server-side regular expression filtering function.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [feat][broker] PIP-452: Customizable topic listing of namespace with properties [pulsar]
Posted by "coderzc (via GitHub)" <gi...@apache.org>.
coderzc commented on code in PR #25160:
URL: https://github.com/apache/pulsar/pull/25160#discussion_r2793273544
##########
pulsar-broker-common/src/main/java/org/apache/pulsar/broker/ServiceConfiguration.java:
##########
@@ -1269,6 +1279,14 @@ The max allowed delay for delayed delivery (in milliseconds). If the broker rece
)
private boolean enableBrokerSideSubscriptionPatternEvaluation = true;
+ @FieldContext(
+ dynamic = false,
+ category = CATEGORY_POLICIES,
+ doc = "Enables watching topic add/remove events on broker side for "
+ + "subscription pattern evaluation."
+ )
+ private boolean enableBrokerTopicListWatcher = true;
Review Comment:
Some explanations have been added to the description of `enableSubscriptionPatternEvaluation`
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [feat][broker] PIP-452: Customizable topic listing of namespace with properties [pulsar]
Posted by "BewareMyPower (via GitHub)" <gi...@apache.org>.
BewareMyPower commented on code in PR #25160:
URL: https://github.com/apache/pulsar/pull/25160#discussion_r2785608895
##########
pulsar-broker-common/src/main/java/org/apache/pulsar/broker/ServiceConfiguration.java:
##########
@@ -1611,7 +1629,7 @@ The max allowed delay for delayed delivery (in milliseconds). If the broker rece
category = CATEGORY_SERVER,
doc = "List of broker interceptor to load, which is a list of broker interceptor names"
)
- private Set<String> brokerInterceptors = new TreeSet<>();
+ private Set<String> brokerInterceptors = new LinkedHashSet<>();
Review Comment:
Why did you change it to a `LinkedHashSet`?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [feat][broker] PIP-452: Customizable topic listing of namespace with properties [pulsar]
Posted by "shibd (via GitHub)" <gi...@apache.org>.
shibd commented on code in PR #25160:
URL: https://github.com/apache/pulsar/pull/25160#discussion_r2791144773
##########
pulsar-broker-common/src/main/java/org/apache/pulsar/broker/ServiceConfiguration.java:
##########
@@ -1269,6 +1279,14 @@ The max allowed delay for delayed delivery (in milliseconds). If the broker rece
)
private boolean enableBrokerSideSubscriptionPatternEvaluation = true;
+ @FieldContext(
+ dynamic = false,
+ category = CATEGORY_POLICIES,
+ doc = "Enables watching topic add/remove events on broker side for "
+ + "subscription pattern evaluation."
+ )
+ private boolean enableBrokerTopicListWatcher = true;
Review Comment:
If a user has disabled: enableSubscriptionPatternEvaluation, then will have a break change.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [feat][broker] PIP-452: Customizable topic listing of namespace with properties [pulsar]
Posted by "BewareMyPower (via GitHub)" <gi...@apache.org>.
BewareMyPower commented on code in PR #25160:
URL: https://github.com/apache/pulsar/pull/25160#discussion_r2791154309
##########
pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/v2/PersistentTopics.java:
##########
@@ -121,9 +123,11 @@ public void getList(
@ApiParam(value = "Specify the bundle name", required = false)
@QueryParam("bundle") String bundle,
@ApiParam(value = "Include system topic")
- @QueryParam("includeSystemTopic") boolean includeSystemTopic) {
+ @QueryParam("includeSystemTopic") boolean includeSystemTopic,
+ @ApiParam(value = "properties for customized topic listing plugin, format: k1=v1,k2=v2")
+ @QueryParam("properties") String propertiesStr) {
Review Comment:
Why did you use a raw string and a manually written parse method `parseProperties`? It seems to be possible to change the type to `Map<String, String>` like `properties` in `updateSubscriptionProperties`.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [feat][broker] PIP-452: Customizable topic listing of namespace with properties [pulsar]
Posted by "coderzc (via GitHub)" <gi...@apache.org>.
coderzc merged PR #25160:
URL: https://github.com/apache/pulsar/pull/25160
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [feat][broker] PIP-452: Customizable topic listing of namespace with properties [pulsar]
Posted by "shibd (via GitHub)" <gi...@apache.org>.
shibd commented on code in PR #25160:
URL: https://github.com/apache/pulsar/pull/25160#discussion_r2793435177
##########
pulsar-broker-common/src/main/java/org/apache/pulsar/broker/ServiceConfiguration.java:
##########
@@ -1269,6 +1279,14 @@ The max allowed delay for delayed delivery (in milliseconds). If the broker rece
)
private boolean enableBrokerSideSubscriptionPatternEvaluation = true;
+ @FieldContext(
+ dynamic = false,
+ category = CATEGORY_POLICIES,
+ doc = "Enables watching topic add/remove events on broker side for "
+ + "subscription pattern evaluation."
+ )
+ private boolean enableBrokerTopicListWatcher = true;
Review Comment:
I see, thanks for explaining
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [feat][broker] PIP-452: Customizable topic listing of namespace with properties [pulsar]
Posted by "coderzc (via GitHub)" <gi...@apache.org>.
coderzc commented on code in PR #25160:
URL: https://github.com/apache/pulsar/pull/25160#discussion_r2791300182
##########
pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/v2/PersistentTopics.java:
##########
@@ -121,9 +123,11 @@ public void getList(
@ApiParam(value = "Specify the bundle name", required = false)
@QueryParam("bundle") String bundle,
@ApiParam(value = "Include system topic")
- @QueryParam("includeSystemTopic") boolean includeSystemTopic) {
+ @QueryParam("includeSystemTopic") boolean includeSystemTopic,
+ @ApiParam(value = "properties for customized topic listing plugin, format: k1=v1,k2=v2")
+ @QueryParam("properties") String propertiesStr) {
Review Comment:
```java
Caused by: java.lang.IllegalStateException: Entity must be null for http method GET.
at org.glassfish.jersey.client.JerseyInvocation.validateHttpMethodAndEntity(JerseyInvocation.java:151)
at org.glassfish.jersey.client.JerseyInvocation.<init>(JerseyInvocation.java:97)
at org.glassfish.jersey.client.JerseyInvocation.<init>(JerseyInvocation.java:93)
at org.glassfish.jersey.client.JerseyInvocation.<init>(JerseyInvocation.java:82)
at org.glassfish.jersey.client.JerseyInvocation$AsyncInvoker.method(JerseyInvocation.java:660)
at org.glassfish.jersey.client.JerseyInvocation$AsyncInvoker.method(JerseyInvocation.java:590)
at org.apache.pulsar.client.admin.internal.BaseResource.asyncGetRequestWithBody(BaseResource.java:194)
at org.apache.pulsar.client.admin.internal.BaseResource.asyncGetRequestWithBody(BaseResource.java:202)
at org.apache.pulsar.client.admin.internal.TopicsImpl.getListAsync(TopicsImpl.java:219)
at org.apache.pulsar.client.admin.internal.TopicsImpl.lambda$getList$0(TopicsImpl.java:174)
at org.apache.pulsar.client.admin.internal.BaseResource.sync(BaseResource.java:365)
... 43 more
Caused by: [CIRCULAR REFERENCE: java.lang.IllegalStateException: Entity must be null for http method GET.]
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [feat][broker] PIP-452: Customizable topic listing of namespace with properties [pulsar]
Posted by "coderzc (via GitHub)" <gi...@apache.org>.
coderzc closed pull request #25160: [feat][broker] PIP-452: Customizable topic listing of namespace with properties
URL: https://github.com/apache/pulsar/pull/25160
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [feat][broker] PIP-452: Customizable topic listing of namespace with properties [pulsar]
Posted by "coderzc (via GitHub)" <gi...@apache.org>.
coderzc commented on code in PR #25160:
URL: https://github.com/apache/pulsar/pull/25160#discussion_r2791158749
##########
pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/v2/PersistentTopics.java:
##########
@@ -121,9 +123,11 @@ public void getList(
@ApiParam(value = "Specify the bundle name", required = false)
@QueryParam("bundle") String bundle,
@ApiParam(value = "Include system topic")
- @QueryParam("includeSystemTopic") boolean includeSystemTopic) {
+ @QueryParam("includeSystemTopic") boolean includeSystemTopic,
+ @ApiParam(value = "properties for customized topic listing plugin, format: k1=v1,k2=v2")
+ @QueryParam("properties") String propertiesStr) {
Review Comment:
Because the GET method does not support parsing the request body.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [feat][broker] PIP-452: Customizable topic listing of namespace with properties [pulsar]
Posted by "coderzc (via GitHub)" <gi...@apache.org>.
coderzc commented on code in PR #25160:
URL: https://github.com/apache/pulsar/pull/25160#discussion_r2785649843
##########
pulsar-broker-common/src/main/java/org/apache/pulsar/broker/ServiceConfiguration.java:
##########
@@ -1611,7 +1629,7 @@ The max allowed delay for delayed delivery (in milliseconds). If the broker rece
category = CATEGORY_SERVER,
doc = "List of broker interceptor to load, which is a list of broker interceptor names"
)
- private Set<String> brokerInterceptors = new TreeSet<>();
+ private Set<String> brokerInterceptors = new LinkedHashSet<>();
Review Comment:
revert it
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [feat][broker] PIP-452: Customizable topic listing of namespace with properties [pulsar]
Posted by "shibd (via GitHub)" <gi...@apache.org>.
shibd commented on code in PR #25160:
URL: https://github.com/apache/pulsar/pull/25160#discussion_r2791103890
##########
pulsar-broker-common/src/main/java/org/apache/pulsar/broker/ServiceConfiguration.java:
##########
@@ -1269,6 +1279,14 @@ The max allowed delay for delayed delivery (in milliseconds). If the broker rece
)
private boolean enableBrokerSideSubscriptionPatternEvaluation = true;
+ @FieldContext(
+ dynamic = false,
+ category = CATEGORY_POLICIES,
+ doc = "Enables watching topic add/remove events on broker side for "
+ + "subscription pattern evaluation."
+ )
+ private boolean enableBrokerTopicListWatcher = true;
Review Comment:
Does this configuration serve the same purpose as enableSubscriptionPatternEvaluation? Can we just continue using enableSubscriptionPatternEvaluation instead?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [feat][broker] PIP-452: Customizable topic listing of namespace with properties [pulsar]
Posted by "shibd (via GitHub)" <gi...@apache.org>.
shibd commented on code in PR #25160:
URL: https://github.com/apache/pulsar/pull/25160#discussion_r2791144773
##########
pulsar-broker-common/src/main/java/org/apache/pulsar/broker/ServiceConfiguration.java:
##########
@@ -1269,6 +1279,14 @@ The max allowed delay for delayed delivery (in milliseconds). If the broker rece
)
private boolean enableBrokerSideSubscriptionPatternEvaluation = true;
+ @FieldContext(
+ dynamic = false,
+ category = CATEGORY_POLICIES,
+ doc = "Enables watching topic add/remove events on broker side for "
+ + "subscription pattern evaluation."
+ )
+ private boolean enableBrokerTopicListWatcher = true;
Review Comment:
If a user disable: enableSubscriptionPatternEvaluation, then will have a break change.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [feat][broker] PIP-452: Customizable topic listing of namespace with properties [pulsar]
Posted by "coderzc (via GitHub)" <gi...@apache.org>.
coderzc commented on code in PR #25160:
URL: https://github.com/apache/pulsar/pull/25160#discussion_r2791158749
##########
pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/v2/PersistentTopics.java:
##########
@@ -121,9 +123,11 @@ public void getList(
@ApiParam(value = "Specify the bundle name", required = false)
@QueryParam("bundle") String bundle,
@ApiParam(value = "Include system topic")
- @QueryParam("includeSystemTopic") boolean includeSystemTopic) {
+ @QueryParam("includeSystemTopic") boolean includeSystemTopic,
+ @ApiParam(value = "properties for customized topic listing plugin, format: k1=v1,k2=v2")
+ @QueryParam("properties") String propertiesStr) {
Review Comment:
Because the GET method does not support passing in the request body.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org