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

   ### Motivation
   
   The serialization and deserialization of `MessageId` became wrong after 
https://github.com/apache/pulsar-client-cpp/pull/132.
   1. The batch size is not serialized.
   2. `BatchedMessageIdImpl` could never be deserialized.
   
   The wrong behaviors could lead to a result that all MessageId objects 
created from deserialization does not have a batch size, which might make 
`ReaderTest.testReaderOnSpecificMessageWithBatches` fail when the cmake build 
type is `Debug`. What's worse is that a MessageId created from deserialization 
is always treated as a `MessageIdImpl`, on which the acknowledgment will have 
wrong behavior.
   
   ### Modifications
   
   Serialize the batch size if it's valid. In deserialization, create a 
`BatchedMessageIdImpl` when the batch index and the batch size are valid as a 
batched message.
   
   There is a problem that if a `MessageId` is created from deserialization, it 
cannot share a `BatchMessageAcker` with other `MessageId` objects. In this 
case, create a fake `BatchMessageAcker` that returns false for both 
`ackIndividual` and `ackCumulative` methods. It will make acknowledgment always 
fail but will fall back to batch index ACK if batch index ACK is enabled.
   
   Add the `-DCMAKE_BUILD_TYPE=Debug` for tests to enable assertions.


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