b-goyal commented on PR #10:
URL: https://github.com/apache/kafka/pull/10#issuecomment-1997287258

   This adds another version of `commitOffsets` that takes the offsets to 
commit as a parameter.
   
   Without this change, getting correct user code is very hard.  Despite 
kafka's at-least-once guarantees, most user code doesn't actually have that 
guarantee, and is almost certainly wrong if doing batch processing.  Getting it 
right requires some very careful synchronization between all consumer threads, 
which is both:
   1) painful to get right
   2) slow b/c of the need to stop all workers during a commit.
   
   This small change simplifies a lot of this.  This was discussed extensively 
on the user mailing list, on the thread "are kafka consumer apps guaranteed to 
see msgs at least once?"
   
   You can also see an example implementation of a user api which makes use of 
this, to get proper at-least-once guarantees by _user_ code, even for batches:
   https://github.com/quantifind/kafka-utils/pull/1
   
   I'm open to any suggestions on how to add unit tests for this.
   


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

To unsubscribe, e-mail: jira-unsubscr...@kafka.apache.org

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

Reply via email to