Vanlightly commented on a change in pull request #11570:
URL: https://github.com/apache/pulsar/pull/11570#discussion_r684338788



##########
File path: pulsar-client-cpp/lib/PartitionedProducerImpl.cc
##########
@@ -87,13 +87,18 @@ unsigned int 
PartitionedProducerImpl::getNumPartitionsWithLock() const {
     return getNumPartitions();
 }
 
-ProducerImplPtr PartitionedProducerImpl::newInternalProducer(unsigned int 
partition) const {
+ProducerImplPtr PartitionedProducerImpl::newInternalProducer(unsigned int 
partition) {
     using namespace std::placeholders;
     std::string topicPartitionName = 
topicName_->getTopicPartitionName(partition);
     auto producer = std::make_shared<ProducerImpl>(client_, 
topicPartitionName, conf_, partition);
-    producer->getProducerCreatedFuture().addListener(
-        
std::bind(&PartitionedProducerImpl::handleSinglePartitionProducerCreated,
-                  
const_cast<PartitionedProducerImpl*>(this)->shared_from_this(), _1, _2, 
partition));
+
+    if (conf_.getLazyStartPartitionedProducers()) {

Review comment:
       Yes, it's required when closing. Also, this method will be called when 
the partition update task runs and see a new number of partitions, so it fits 
well with that. 




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