You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@rocketmq.apache.org by "lizhanhui (via GitHub)" <gi...@apache.org> on 2023/12/01 02:15:23 UTC

[PR] fix #639 fix semantics of topicOfInterest [rocketmq-clients]

lizhanhui opened a new pull request, #642:
URL: https://github.com/apache/rocketmq-clients/pull/642

   <!-- Please make sure the target branch is right. In most case, the target branch should be `master`. -->
   
   ### Which Issue(s) This PR Fixes
   
   fix #639 
   
   ### Brief Description
   
   Fix semantics of topicOfInterest, which should be a reader
   
   ### How Did You Test This Change?
   


-- 
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-unsubscribe@rocketmq.apache.org

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


Re: [PR] fix #639 fix semantics of topicOfInterest [rocketmq-clients]

Posted by "aaron-ai (via GitHub)" <gi...@apache.org>.
aaron-ai commented on code in PR #642:
URL: https://github.com/apache/rocketmq-clients/pull/642#discussion_r1411673524


##########
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:
   Does `ProducerImpl#topicOfInterest` simply retrieve a copy of the topics for sending messages?



-- 
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-unsubscribe@rocketmq.apache.org

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


Re: [PR] fix #639 fix semantics of topicOfInterest [rocketmq-clients]

Posted by "lizhanhui (via GitHub)" <gi...@apache.org>.
lizhanhui merged PR #642:
URL: https://github.com/apache/rocketmq-clients/pull/642


-- 
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-unsubscribe@rocketmq.apache.org

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


Re: [PR] fix #639 fix semantics of topicOfInterest [rocketmq-clients]

Posted by "lizhanhui (via GitHub)" <gi...@apache.org>.
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-unsubscribe@rocketmq.apache.org

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