codelipenghui commented on a change in pull request #8234:
URL: https://github.com/apache/pulsar/pull/8234#discussion_r502871661
##########
File path:
pulsar-broker/src/main/java/org/apache/pulsar/broker/service/persistent/PersistentTopic.java
##########
@@ -2427,14 +2427,8 @@ public void onUpdate(TopicPolicies policies) {
}
}
- private Optional<Policies> getNamespacePolicies(){
- try {
- return
Optional.ofNullable(brokerService.pulsar().getAdminClient().namespaces()
- .getPolicies(TopicName.get(topic).getNamespace()));
- } catch (Exception e) {
- log.error("get namespace policies fail", e);
- }
- return Optional.empty();
+ private Optional<Policies> getNamespacePolicies() {
+ return DispatchRateLimiter.getPolicies(brokerService, topic);
Review comment:
Why do we need to get the namespace policy from the DispatchRateLimiter?
If we don't enable the dispatch rate limiter, is it possible to get the
namespace policy?
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]