315157973 commented on a change in pull request #8234:
URL: https://github.com/apache/pulsar/pull/8234#discussion_r502871966



##########
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:
       This is a static tool method, and has nothing to do with whether 
DispatchRateLimiter is enabled




----------------------------------------------------------------
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]


Reply via email to