wolfstudy commented on issue #4537: Go client: Missing ability to retrieve 
MessageID from pulsar.ProducerMessage
URL: https://github.com/apache/pulsar/issues/4537#issuecomment-504013751
 
 
   Thank you for pointing this out. The documentation here is incorrect. The 
`MessageID` field needs to be obtained after the consumer receives the message. 
You can try the following way:
   
   ```
   for i := 0; i < 10; i++ {
        msg, err := consumer.Receive(ctx)
        if err != nil {
                log.Fatal(err)
        }
        err = consumer.Ack(msg)
        assert.Nil(t, err)
           fmt.Printf("Message %s succesfully received", msg.ID())
   }
   ```

----------------------------------------------------------------
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:
[email protected]


With regards,
Apache Git Services

Reply via email to