hrsakai commented on issue #389:
URL: 
https://github.com/apache/pulsar-client-go/issues/389#issuecomment-741560624


   I reproduce senario 2.
   Unacked messages doesn't be redelivered.
   
   Steps to reproduce
   1. Consumer receives messages and unacks some messages.
   2. Unloading the topic.
   3. When reconnecting to broker, startMessageID will be changed from 
[ledgerId:0,entryId:0] to value returned by 
`getPreviousMessage(nextMessageInQueue)` if consumer's receiverQueue is not 
empty.
   
https://github.com/apache/pulsar-client-go/blob/v0.3.0/pulsar/consumer_partition.go#L976
   4. Broker resends unacked messages to consumer, but consumer discards them 
(implicitly acks them) because those messageIDs are lower than the new 
startMessageID.
   
https://github.com/apache/pulsar-client-go/blob/v0.3.0/pulsar/consumer_partition.go#L507-L510
   
https://github.com/apache/pulsar-client-go/blob/v0.3.0/pulsar/consumer_partition.go#L570
   5. As a result, unacked messages are not redelivered to a client application.
   
   (Value returned by `getPreviousMessage(nextMessageInQueue)` looks like the 
last read messageID before unloading the topic.)
   


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


Reply via email to