A-Wanderer commented on a change in pull request #14604:
URL: https://github.com/apache/pulsar/pull/14604#discussion_r834491610
##########
File path: pulsar-client-cpp/lib/ProducerImpl.cc
##########
@@ -856,7 +856,18 @@ bool ProducerImpl::ackReceived(uint64_t sequenceId,
MessageId& rawMessageId) {
lastSequenceIdPublished_ = sequenceId + op.messagesCount_ - 1;
pendingMessagesQueue_.pop_front();
-
+ int totalChunks = op.metadata_.num_chunks_from_msg();
+ if (totalChunks > 1) {
+ if (op.metadata_.chunk_id() == 0) {
+ op.chunkedMessageId_ = MessageId(partition_,
rawMessageId.ledgerId(), rawMessageId.entryId(),
+ rawMessageId.batchIndex());
+ } else if (op.metadata_.chunk_id() == totalChunks - 1) {
+ MessageId lastMessageId(partition_, rawMessageId.ledgerId(),
rawMessageId.entryId(),
+ rawMessageId.batchIndex());
+ op.chunkedMessageId_ = MessageId(op.chunkedMessageId_,
lastMessageId);
Review comment:
The chunkedMessageId_ was defined with `MessageId` type, now I choose
that which is defined with `std::shared_pre<MessageId>`,otherwise we can't pass
changes between OpSendMsg(the var of MessageIdImpl is defined `const`)
--
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]