Gleiphir2769 commented on code in PR #1071:
URL: https://github.com/apache/pulsar-client-go/pull/1071#discussion_r1317333379
##########
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:
I think we can remove this doneCh. The goal of this UT is to verify whether
consumer can discard the oldest chunk message. It has no impact whether the
callback of sendRequest is called or not.
##########
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:
Should we add the parameters`wholePayload ` `callbackOnce ` and
`chunkRecorder `? I think it's more appropriate to make them inside
the`sendSingleChunk `.
--
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]