RobertIndie commented on PR #16797:
URL: https://github.com/apache/pulsar/pull/16797#issuecomment-1203452715
> In this case, we should not check the size here. Instead, if you tend to
validate whether the total_chunk_msg_size is right, you should check it when
the chunked message is complete.
Hi @BewareMyPower . IIUC, This approach has the same effect as this PR.
```java
if (chunkedMsgCtx == null || chunkedMsgCtx.chunkedMsgBuffer == null
|| msgMetadata.getChunkId() !=
(chunkedMsgCtx.lastChunkedMessageId + 1)
|| chunkedMsgCtx.chunkedMsgBuffer.readableBytes() +
compressedPayload.readableBytes()
> msgMetadata.getTotalChunkMsgSize()) {
```
If we reach the last validation:
`chunkedMsgCtx.chunkedMsgBuffer.readableBytes() +
compressedPayload.readableBytes()
> msgMetadata.getTotalChunkMsgSize()`, that means we are
handling the last chunk.
--
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]