michaeljmarshall commented on a change in pull request #10683:
URL: https://github.com/apache/pulsar/pull/10683#discussion_r637683706
##########
File path:
pulsar-broker/src/main/java/org/apache/pulsar/broker/service/persistent/SubscribeRateLimiter.java
##########
@@ -51,7 +51,7 @@ public SubscribeRateLimiter(PersistentTopic topic) {
subscribeRateLimiter = new ConcurrentHashMap<>();
this.executorService = brokerService.pulsar().getExecutor();
// get subscribeRate from topic level policies
- this.subscribeRate =
Optional.ofNullable(brokerService.getTopicPolicies(TopicName.get(this.topicName)))
+ this.subscribeRate = Optional.ofNullable(topic.getTopicPolicies())
Review comment:
I agree that `Optional` is be better. I'll refactor this PR to use
`Optional`.
--
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]