geniusjoe commented on PR #1211:
URL: 
https://github.com/apache/pulsar-client-go/pull/1211#issuecomment-2107100692

   I think the unit test case ran fail is because `TestGetMessagesByID` 
function in `pulsaradmin/pkg/admin/subscription_test.go` use message 
`id.String()` as a map key to check if current messages are in a same batch. 
   When we change `id.String()` from `fmt.Sprintf("%d:%d:%d", id.ledgerID, 
id.entryID, id.partitionIdx)`
        to `fmt.Sprintf("%d:%d:%d:%d", id.ledgerID, id.entryID, 
id.partitionIdx, id.batchIdx)`, map key changed, so that the test case cannot 
distinguish messages in the same batch.
   
   ```
        for i := 0; i <= numberMessages; i++ {
                producer.SendAsync(ctx, &pulsar.ProducerMessage{
                        Payload: []byte(fmt.Sprintf("hello-%d", i)),
                }, func(id pulsar.MessageID, message *pulsar.ProducerMessage, 
err error) {
                        assert.Nil(t, err)
                        messageIDMap[id.String()]++
                        wg.Done()
                })
        }
   ```
   
   If we need to fix test case, we can replace `messageIDMap[id.String()]` to 
`messageIDMap[fmt.Sprintf("%d:%d:%d", id.ledgerID, id.entryID, 
id.partitionIdx)]`, but I think this pr is an incompatibility change, so it 
should be greater to add change log in documentation. 


-- 
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]

Reply via email to