BewareMyPower commented on code in PR #17125:
URL: https://github.com/apache/pulsar/pull/17125#discussion_r963347595


##########
pulsar-client-cpp/lib/Message.cc:
##########
@@ -191,6 +192,12 @@ uint64_t Message::getEventTimestamp() const { return impl_ 
? impl_->getEventTime
 
 bool Message::operator==(const Message& msg) const { return getMessageId() == 
msg.getMessageId(); }
 
+KeyValue Message::getKeyValueData(const KeyValueEncodingType& 
keyValueEncodingType) const {
+    const std::shared_ptr<KeyValueImpl> keyValueImpl =
+        std::make_shared<KeyValueImpl>((char*)getData(), getLength(), 
keyValueEncodingType);
+    return KeyValue(keyValueImpl);

Review Comment:
   ```suggestion
       return KeyValue(std::make_shared<KeyValueImpl>(static_cast<const 
char*>(getData()), getLength(),
                                                      keyValueEncodingType));
   
   ```



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