Skip to content
This repository has been archived by the owner on Mar 24, 2021. It is now read-only.

Commit

Permalink
Merge pull request #857 from athal7/patch-1
Browse files Browse the repository at this point in the history
Prevent attempts to reset the offset when trying to fetch consumer lag.
  • Loading branch information
Emmett J. Butler authored Aug 21, 2018
2 parents 69b501d + 52c4194 commit 873a049
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion pykafka/cli/kafka_tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,8 @@ def fetch_consumer_lag(client, topic, consumer_group):
"""
latest_offsets = fetch_offsets(client, topic, 'latest')
consumer = topic.get_simple_consumer(consumer_group=consumer_group,
auto_start=False)
auto_start=False,
reset_offset_on_fetch=False)
current_offsets = consumer.fetch_offsets()
return {p_id: (latest_offsets[p_id].offset[0], res.offset)
for p_id, res in current_offsets}
Expand Down

0 comments on commit 873a049

Please sign in to comment.