tongsucn commented on PR #66:
URL: https://github.com/apache/pulsar-client-cpp/pull/66#issuecomment-1319686471
> I just found the `batchReceive` method added in #21. Maybe if the producer
enables batching, the consumer must combine `batchReceive` and the
`releaseData` APIs. In this case, I prefer not throwing an exception when
`data_` is `nullptr`. Instead, fallback to copying the data rather than moving.
Well, I think the result of `batchReceive` may contain data from multiple
message batches, which make the situation more complicated. Falling back
without telling caller may confuse the callers.
Under current design, `pulsar::Message` is actually an *agent* of the
message data rather than a *container*. An *agent* should NOT give the
ownership of the data to others, because it actually **DOES NOT OWN** the data.
Therefore, I think interfaces like `releaseData` should be avoided.
--
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]