Skip to content

Conversation

@coderzc
Copy link
Member

@coderzc coderzc commented Jan 11, 2026

Fixes #xyz

Main Issue: #xyz

PIP: #xyz

Motivation

Modifications

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:

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

  • doc
  • doc-required
  • doc-not-needed
  • doc-complete

Matching PR in forked repository

PR in forked repository:

@github-actions github-actions bot added PIP doc Your PR contains doc changes, no matter whether the changes are in markdown or code files. labels Jan 11, 2026
@coderzc coderzc force-pushed the pip-452 branch 11 times, most recently from 06e3b36 to 7348e97 Compare January 12, 2026 16:42
pip/pip-452.md Outdated
.thenApply(topics -> TopicListingResult.success(topics, false));
}
}).thenCompose(listingResult -> {
List<String> rawTopics = listingResult.getTopics();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You don't have to copy so much code here, which does not focus on the key change. The only thing that matters is that what will replace the following existing code:

                        return getBrokerService().pulsar().getNamespaceService()
                                .getListOfUserTopics(namespaceName, mode)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Simplified pseudocode

pip/pip-452.md Outdated
* Return an invalid result indicating that the caller should continue with the default logic.
*/
public static TopicListingResult passThrough() {
return PASS_THROUGH_INSTANCE;
Copy link
Contributor

@BewareMyPower BewareMyPower Jan 13, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This design is a bit over-abstraction. IMO, the following design could be simpler and clearer.

public record TopicListingResult(List<String> topics, boolean filtered) {}
    /**
     * @return the future of the result, if it's empty, fall back to the built-in implementation to list all topics
     */
    default CompletableFuture<Optional<TopicListingResult>> interceptGetTopicsOfNamespace(

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since the built-in implementation is very simple that calls method directly on the NamespaceService, I think the fallback logic is unnecessary.

Copy link
Member Author

@coderzc coderzc Jan 13, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since we allow the configuration of multiple interceptors, the return here means that the result of current interception is not processed this method. If all the interceptors do not process the method, the default logic will be used.

In addition, the interception configuration is empty by default. In this case, we still need to fall back to the default logic.

Copy link
Member Author

@coderzc coderzc Jan 13, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

default CompletableFuture<Optional<TopicListingResult>> interceptGetTopicsOfNamespace()

Applied this suggestion

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR introduces PIP-452, which proposes a design for customizable topic listing in Pulsar's GetTopicsOfNamespace command. The proposal aims to make topic discovery more flexible by allowing clients to pass context properties and enabling plugins to override the default metadata store scanning behavior.

Changes:

  • Adds protocol extension to include properties field in CommandGetTopicsOfNamespace
  • Introduces BrokerInterceptor interface method for custom topic listing logic
  • Extends REST API and CLI to support properties parameter for topic listing

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@coderzc coderzc changed the title [feat][broker] PIP-452: Customizable Topic Listing in GetTopicsOfNamespace with properties [feat][broker] PIP-452: Customizable topic listing of namespace with properties Jan 14, 2026
@coderzc coderzc force-pushed the pip-452 branch 2 times, most recently from cfa592c to 70224d9 Compare January 14, 2026 06:19
@coderzc coderzc added this to the 4.2.0 milestone Jan 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

doc Your PR contains doc changes, no matter whether the changes are in markdown or code files. PIP

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants