kafka-php icon indicating copy to clipboard operation
kafka-php copied to clipboard

bugfix, issue141,179: lost message when consumer restart

Open chongchaoyu opened this issue 7 years ago • 1 comments

The cause of this issue: When no new messages is available, the fetch request is also successful, and the message array in response is empty, but consumer also commits the offset. At this situation the consumer offset is equal to commit offset, so if you don't stop the consumer, the commit offset will be corrected by next successful fetch request, if you restart the consumer, the offset request will return the offset you committed last time.

Base on kafka protocol, highwaterMarkOffset represents "The offset at the end of the log for this partition. This can be used by the client to determine how many messages behind the end of the log they are.", so it is useless.

chongchaoyu avatar Feb 01 '18 03:02 chongchaoyu

@chongchaoyu I think that @noname007's solution is simpler and seems to address the issue, we just need tests to confirm that the problem has been solved. With that said, should we close this PR in favour of #189?

lcobucci avatar May 23 '18 11:05 lcobucci