From a049e19a1b3220d8eb85e380a564942e02543ef5 Mon Sep 17 00:00:00 2001 From: Enrico Canzonieri Date: Fri, 20 Mar 2015 15:29:19 -0700 Subject: [PATCH] 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. --- kafka/consumer/simple.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kafka/consumer/simple.py b/kafka/consumer/simple.py index 3d250eaf2..b50de61f8 100644 --- a/kafka/consumer/simple.py +++ b/kafka/consumer/simple.py @@ -214,8 +214,8 @@ def seek(self, offset, whence): # Reset queue and fetch offsets since they are invalid self.fetch_offsets = self.offsets.copy() + self.count_since_commit += 1 if self.auto_commit: - self.count_since_commit += 1 self.commit() self.queue = Queue()