AnonHxy commented on a change in pull request #14641:
URL: https://github.com/apache/pulsar/pull/14641#discussion_r823652295
##########
File path:
pulsar-broker/src/main/java/org/apache/pulsar/broker/service/AbstractDispatcherMultipleConsumers.java
##########
@@ -119,17 +119,13 @@ public Consumer getNextConsumer() {
return null;
}
- if (currentConsumerRoundRobinIndex >= consumerList.size()) {
- currentConsumerRoundRobinIndex = 0;
- }
-
int currentRoundRobinConsumerPriority =
consumerList.get(currentConsumerRoundRobinIndex).getPriorityLevel();
// first find available-consumer on higher level unless currentIndex
is not on highest level which is 0
if (currentRoundRobinConsumerPriority != 0) {
int higherPriorityConsumerIndex =
getConsumerFromHigherPriority(currentRoundRobinConsumerPriority);
if (higherPriorityConsumerIndex != -1) {
- currentConsumerRoundRobinIndex = higherPriorityConsumerIndex +
1;
+ currentConsumerRoundRobinIndex = (higherPriorityConsumerIndex
+ 1) % consumerList.size();
Review comment:
Should we need check the consumer validation use
`org.apache.pulsar.broker.service.AbstractDispatcherMultipleConsumers#isConsumerAvailable`?
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]