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

lost message when consumer restart

Open noname007 opened this issue 7 years ago • 6 comments

desc in the #141

i think maybe this a problem ,so i issue this issue....

noname007 avatar Jan 30 '18 18:01 noname007

@noname007 as said before we do need the test to prove that this is an issue, though... we have tests running in the last development versions saying it's not

lcobucci avatar Jan 31 '18 11:01 lcobucci

@lcobucci I think I have found the reason for this issue, and I will create a PR to this, please review it. The reason is: 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.

chongchaoyu avatar Jan 31 '18 12:01 chongchaoyu

#186 abosolutely that's not a test but the minimal code of my condition represention

noname007 avatar Jan 31 '18 13:01 noname007

@noname007 it's a great start, thanks!

lcobucci avatar Jan 31 '18 14:01 lcobucci

also faced the problem of losing the last message

skn420 avatar Apr 27 '18 16:04 skn420

@skn2215 when it run again after exit caused by exception?

noname007 avatar May 23 '18 14:05 noname007