Skip to content

Commit a049e19

Browse files
committed
Increase count_since_commit on seek
When auto_commit is False this change enables an explicit call to commit() to actually commit the offsets. Otherwise a consumer won't be able to commit until at least one message is read.
1 parent a5b1c8d commit a049e19

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

kafka/consumer/simple.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -214,8 +214,8 @@ def seek(self, offset, whence):
214214

215215
# Reset queue and fetch offsets since they are invalid
216216
self.fetch_offsets = self.offsets.copy()
217+
self.count_since_commit += 1
217218
if self.auto_commit:
218-
self.count_since_commit += 1
219219
self.commit()
220220

221221
self.queue = Queue()

0 commit comments

Comments
 (0)