Skip to content

Commit

Permalink
Add offset parameter to Consumer class which allows user to consume f…
Browse files Browse the repository at this point in the history
…rom a previously saved spot
  • Loading branch information
colindickson committed Jan 22, 2013
1 parent 0d5af6b commit 91c941a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions kafka/consumer.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ class Consumer(kafka.io.IO):
# seconds.
DEFAULT_POLLING_INTERVAL = 2

def __init__(self, topic, partition=0, host='localhost', port=9092):
def __init__(self, topic, partition=0, offset=0, host='localhost', port=9092):
kafka.io.IO.__init__(self, host, port)

#: The topic queue to consume.
Expand All @@ -23,7 +23,7 @@ def __init__(self, topic, partition=0, host='localhost', port=9092):
self.partition = partition

#: Offset in the Kafka queue in bytes?
self.offset = 0
self.offset = offset

#: Maximum message size to consume.
self.max_size = self.MAX_SIZE
Expand Down

0 comments on commit 91c941a

Please sign in to comment.