lizhanhui commented on code in PR #642:
URL: https://github.com/apache/rocketmq-clients/pull/642#discussion_r1411708765


##########
cpp/source/rocketmq/ProducerImpl.cpp:
##########
@@ -575,9 +576,22 @@ void 
ProducerImpl::onOrphanedTransactionalMessage(MessageConstSharedPtr message)
   }
 }
 
-void ProducerImpl::topicsOfInterest(std::vector<std::string> topics) {
+void ProducerImpl::topicsOfInterest(std::vector<std::string> &topics) {
   absl::MutexLock lk(&topics_mtx_);
-  topics_.swap(topics);
+  for (auto& topic : topics_) {

Review Comment:
   This function exposes topics that are in use to other internal components. 
The newly added withTopics, similar to subscribe, allows application developers 
to specify topics that will be used in future for the purpose of route info 
prefetch. 



-- 
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: commits-unsubscr...@rocketmq.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to