gunli commented on code in PR #1071:
URL: https://github.com/apache/pulsar-client-go/pull/1071#discussion_r1317986414
##########
pulsar/message_chunking_test.go:
##########
@@ -548,30 +556,57 @@ func createTestMessagePayload(size int) []byte {
}
//nolint:all
-func sendSingleChunk(p Producer, uuid string, chunkID int, totalChunks int) {
+func sendSingleChunk(p Producer, uuid string, chunkID int, totalChunks int,
wholePayload string, callbackOnce *sync.Once, cr *chunkRecorder) {
msg := &ProducerMessage{
Payload: []byte(fmt.Sprintf("chunk-%s-%d|", uuid, chunkID)),
}
producerImpl := p.(*producer).producers[0].(*partitionProducer)
- mm := producerImpl.genMetadata(msg, len(msg.Payload), time.Now())
+ mm := producerImpl.genMetadata(msg, len(wholePayload), time.Now())
mm.Uuid = proto.String(uuid)
mm.NumChunksFromMsg = proto.Int32(int32(totalChunks))
- mm.TotalChunkMsgSize = proto.Int32(int32(len(msg.Payload)))
+ mm.TotalChunkMsgSize = proto.Int32(int32(len(wholePayload)))
mm.ChunkId = proto.Int32(int32(chunkID))
producerImpl.updateMetadataSeqID(mm, msg)
- doneCh := make(chan struct{})
Review Comment:
OK, I have deleted these line in a new commit.
##########
pulsar/message_chunking_test.go:
##########
@@ -548,30 +556,57 @@ func createTestMessagePayload(size int) []byte {
}
//nolint:all
-func sendSingleChunk(p Producer, uuid string, chunkID int, totalChunks int) {
+func sendSingleChunk(p Producer, uuid string, chunkID int, totalChunks int,
wholePayload string, callbackOnce *sync.Once, cr *chunkRecorder) {
Review Comment:
Hmm, in the current implemention, all the chunking sendRequest should share
the whole message payload, callbackOnce, chunkRecorder, see `internalSend()`
and `addRequestToBatch()`, I add these params just want to make the send
procedure work correctly, I think it better to keep them.
--
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]