315157973 commented on a change in pull request #10188:
URL: https://github.com/apache/pulsar/pull/10188#discussion_r616577921
##########
File path:
pulsar-broker/src/main/java/org/apache/pulsar/broker/service/AbstractTopic.java
##########
@@ -199,14 +220,34 @@ protected boolean isConsumersExceededOnTopic() {
if (maxConsumersPerTopic > 0 && maxConsumersPerTopic <=
getNumberOfConsumers()) {
return true;
}
+
+ final int maxSameAddressConsumers =
brokerService.pulsar().getConfiguration()
+ .getMaxSameAddressConsumersPerTopic();
Review comment:
I suggest to open a check independently and let the client know clearly
that it is because the Consumer of a single IP reaches the upper limit.
Because we will add namespace and topic level Policies in the future. Should
not be mixed with max_consumers_per_topic.
Producer is the same.
##########
File path:
pulsar-broker/src/main/java/org/apache/pulsar/broker/service/persistent/PersistentSubscription.java
##########
@@ -1096,5 +1096,18 @@ public boolean checkAndUnblockIfStuck() {
return dispatcher.checkAndUnblockIfStuck();
}
+ @Override
+ public int getNumberOfSameAddressConsumers(final String clientAddress) {
Review comment:
There is still duplicate code here, can we use default to move it to the
interface?
It looks stateless.
--
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]