zhanghaou commented on a change in pull request #7968:
URL: https://github.com/apache/pulsar/pull/7968#discussion_r483598157
##########
File path:
pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/PersistentTopicsBase.java
##########
@@ -2417,6 +2417,53 @@ protected void internalGetMaxProducers(AsyncResponse
asyncResponse) {
return
pulsar().getTopicPoliciesService().updateTopicPoliciesAsync(topicName,
topicPolicies.get());
}
+ protected void internalGetMaxConsumers(AsyncResponse asyncResponse) {
+ validateAdminAccessForTenant(namespaceName.getTenant());
+ validatePoliciesReadOnlyAccess();
+ if (topicName.isGlobal()) {
+ validateGlobalNamespaceOwnership(namespaceName);
+ }
+ checkTopicLevelPolicyEnable();
+ Optional<Integer> maxConsumers = getTopicPolicies(topicName)
+ .map(TopicPolicies::getMaxConsumerPerTopic);
+ if (!maxConsumers.isPresent()) {
+ asyncResponse.resume(Response.noContent().build());
+ } else {
+ asyncResponse.resume(maxConsumers.get());
+ }
+ }
Review comment:
How about making a new PR to resolve them all?
----------------------------------------------------------------
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]