lordcheng10 commented on a change in pull request #14970:
URL: https://github.com/apache/pulsar/pull/14970#discussion_r840472131
##########
File path:
pulsar-broker/src/main/java/org/apache/pulsar/broker/service/persistent/PersistentDispatcherMultipleConsumers.java
##########
@@ -153,6 +153,13 @@ public synchronized void addConsumer(Consumer consumer)
throws BrokerServiceExce
throw new ConsumerBusyException("Subscription reached max
consumers limit");
}
+ if (consumerList.contains(consumer)) {
Review comment:
Yes so I think we should write a method like
org.apache.pulsar.broker.service.Producer#isSuccessorTo to judge whether the
previous consumer object should be overwritten by consumerEpoch,like this:
public boolean isSuccessorTo(Consumer other){
return Objects.equals(cnx.clientAddress(), other.cnx.clientAddress())
&& consumerId == other.consumerId
&& other.consumerEpoch < consumerEpoch;
}
--
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]