yulangz commented on code in PR #541:
URL: https://github.com/apache/rocketmq-clients/pull/541#discussion_r1227491594
##########
cpp/source/rocketmq/Producer.cpp:
##########
@@ -87,7 +87,8 @@ ProducerBuilder&
ProducerBuilder::withConfiguration(Configuration configuration)
}
ProducerBuilder& ProducerBuilder::withTopics(const std::vector<std::string>&
topics) {
- impl_->topicsOfInterest(topics);
+ auto topics_copy = topics;
Review Comment:
1. The input parameter of `ProducerBuilder::withTopics` is a const
reference, while the input parameter of `topicsOfInterest` is not a constant
reference. The original approach cannot be compiled.
2. The internal implementation of `topicsOfInterest` will use `std::
vector<>. swap()`, which will cause the internal memory space held by the
incoming `topics` to be swapped out, which does not comply with the semantics
of read-only input parameters for `withTopics`.
##########
cpp/source/client/ClientManagerImpl.cpp:
##########
@@ -764,7 +764,7 @@ State ClientManagerImpl::state() const {
}
MessageConstSharedPtr ClientManagerImpl::wrapMessage(const rmq::Message& item)
{
- assert(item.topic().resource_namespace() == resource_namespace_);
+ // assert(item.topic().resource_namespace() == resource_namespace_);
Review Comment:
The resource_namespace_ is always "", this causes this assert to fail.
--
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]