BewareMyPower commented on code in PR #583:
URL: https://github.com/apache/pulsar-client-cpp/pull/583#discussion_r3331989829


##########
lib/Message.cc:
##########
@@ -239,6 +239,13 @@ const std::string& Message::getProducerName() const 
noexcept {
     return impl_->metadata.producer_name();
 }
 
+std::optional<const std::string*> Message::getReplicatedFrom() const {
+    if (!impl_ || !impl_->metadata.has_replicated_from()) {
+        return std::nullopt;
+    }
+    return &impl_->metadata.replicated_from();
+}

Review Comment:
   It should not return an empty string unless it's misconfigured (i.e. the 
replicated cluster is an empty string). Though it should also never happen.



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