You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by "merlimat (via GitHub)" <gi...@apache.org> on 2023/03/15 19:49:04 UTC

[GitHub] [pulsar-client-cpp] merlimat opened a new pull request, #218: Use shared_ptr for topic name in message ids

merlimat opened a new pull request, #218:
URL: https://github.com/apache/pulsar-client-cpp/pull/218

   ### Motivation
   
   `Message` and `MessageId` are exposing `const std::string& getTopic()` method that returns a reference to an internal variable. 
   
   If the consumer is destroyed the message & messageId object will become invalid and calling `getTopic()` will read an invalid memory location.
   
   The current situation is very error prone and can be a bigger problem when using regex subscription, since a topic can be deleted and the consumer will be closed in the background.
   
   ### Modifications
   
   Instead of keeping a `std::string&`, changed to use a `std::shared_ptr<std::string>` so that `Message` and `MessageId` instances will be valid regardless of the consumer.
   
   
   


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

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


[GitHub] [pulsar-client-cpp] BewareMyPower merged pull request #218: Use shared_ptr for topic name in message ids

Posted by "BewareMyPower (via GitHub)" <gi...@apache.org>.
BewareMyPower merged PR #218:
URL: https://github.com/apache/pulsar-client-cpp/pull/218


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

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