shibd commented on code in PR #54:
URL: https://github.com/apache/pulsar-client-cpp/pull/54#discussion_r1000271534


##########
lib/ConsumerImpl.cc:
##########
@@ -242,10 +242,11 @@ void ConsumerImpl::handleCreateConsumer(const 
ClientConnectionPtr& cnx, Result r
         consumerCreatedPromise_.setValue(get_shared_this_ptr());
     } else {
         if (result == ResultTimeout) {
+            client_.cleanupConsumer(this);

Review Comment:
   Why need cleanup consumer on here? When the connect timeout, no consumer is 
added to the client.
   
   



##########
lib/MultiTopicsConsumerImpl.cc:
##########
@@ -886,3 +906,8 @@ void MultiTopicsConsumerImpl::messageProcessed(Message& 
msg) {
 std::shared_ptr<MultiTopicsConsumerImpl> 
MultiTopicsConsumerImpl::get_shared_this_ptr() {
     return 
std::dynamic_pointer_cast<MultiTopicsConsumerImpl>(shared_from_this());
 }
+
+void MultiTopicsConsumerImpl::beforeConnectionChange(ClientConnection& cnx) {
+    consumers_.forEachValue(
+        [&cnx](const ConsumerImplPtr& consumer) { 
consumer->beforeConnectionChange(cnx); });

Review Comment:
   For `MultiTopicConsumerImpl`, It shouldn't be connected, right? 
   
   Should it be more reasonable to change this implementation to throw an 
exception or add an empty implementation to `ConsumerImplBase`?



-- 
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]

Reply via email to