BewareMyPower opened a new pull request #6812:
URL: https://github.com/apache/pulsar/pull/6812


   ### Motivation
   
   After commit of [#4817](https://github.com/apache/pulsar/pull/4811), the 
send callback's 2nd argument became `MessageId`, but the `MessageId` in 
callback is always the default value `(-1, -1, -1, -1)`. We need the message id 
in send callback if messages were sent successfully.
   
   The problem is that the correct message id has been retrieved in 
`ProducerImpl::ackReceived` but not passed to the user provided callback. 
Because after messages were sent to `BatchMessageContainer`, the wrapper of 
user provided callback used the `MessageId` of user constructed `Message` as 
the 2nd argument, which is always `(-1, -1, -1, -1)`.
   
   ### Modifications
   
   - Remove useless field `messageId` of 
`BatchMessageContainer::MessageContainer`. Then add `const MessageId&` argument 
to `batchMessageCallBack` instead.
   - Add tests for message id in send callback. Specially, for a batched 
message, each internal message's batch index was verified.
   
   ### Verifying this change
   
   - [ ] Make sure that the change passes the CI checks.
   
   This change added tests and can be verified as follows:
   
   Run `BasicEndToEndTest.testSendCallback` and 
`BatchMessageTest.testSendCallback`.
   


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

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to