eolivelli commented on a change in pull request #14970:
URL: https://github.com/apache/pulsar/pull/14970#discussion_r840281674
##########
File path:
pulsar-broker/src/main/java/org/apache/pulsar/broker/service/persistent/PersistentDispatcherMultipleConsumers.java
##########
@@ -153,6 +153,14 @@ public synchronized void addConsumer(Consumer consumer)
throws BrokerServiceExce
throw new ConsumerBusyException("Subscription reached max
consumers limit");
}
+ if (consumerList.contains(consumer)) {
+ log.warn("[{}] Consumer with the same id is already created:"
+ + " consumerId={}, consumer={}",
+ consumer.cnx().clientAddress(), consumer.consumerId(),
consumer);
+ throw new BrokerServiceException("Consumer with the same id is
already created!");
Review comment:
what about using ConsumerBusyException ?
##########
File path:
pulsar-broker/src/main/java/org/apache/pulsar/broker/service/persistent/PersistentDispatcherMultipleConsumers.java
##########
@@ -153,6 +153,14 @@ public synchronized void addConsumer(Consumer consumer)
throws BrokerServiceExce
throw new ConsumerBusyException("Subscription reached max
consumers limit");
}
+ if (consumerList.contains(consumer)) {
+ log.warn("[{}] Consumer with the same id is already created:"
+ + " consumerId={}, consumer={}",
+ consumer.cnx().clientAddress(), consumer.consumerId(),
consumer);
+ throw new BrokerServiceException("Consumer with the same id is
already created!");
+
Review comment:
nit: remove useless newline
--
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]