diff options
author | Dana Powers <dana.powers@gmail.com> | 2016-02-02 17:06:16 -0800 |
---|---|---|
committer | Dana Powers <dana.powers@gmail.com> | 2016-02-02 17:06:16 -0800 |
commit | e90094ca82a23934eb08a3e19dc1c248ca0e525e (patch) | |
tree | 1b0ce73f5865ad5bcd75f63959053caeeae420ea | |
parent | d56d2faddabd36ecbec73954bd4a8f17ed501e84 (diff) | |
download | kafka-python-e90094ca82a23934eb08a3e19dc1c248ca0e525e.tar.gz |
KAFKA-3191: Improve offset committing docstrings
-rw-r--r-- | kafka/consumer/group.py | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/kafka/consumer/group.py b/kafka/consumer/group.py index b31980b..ebba440 100644 --- a/kafka/consumer/group.py +++ b/kafka/consumer/group.py @@ -268,7 +268,9 @@ class KafkaConsumer(six.Iterator): This commits offsets only to Kafka. The offsets committed using this API will be used on the first fetch after every rebalance and also on startup. As such, if you need to store offsets in anything other than - Kafka, this API should not be used. + Kafka, this API should not be used. To avoid re-processing the last + message read if a consumer is restarted, the committed offset should be + the next message your application should consume, i.e.: last_offset + 1. This is an asynchronous call and will not block. Any errors encountered are either passed to the callback (if provided) or discarded. @@ -300,7 +302,9 @@ class KafkaConsumer(six.Iterator): This commits offsets only to Kafka. The offsets committed using this API will be used on the first fetch after every rebalance and also on startup. As such, if you need to store offsets in anything other than - Kafka, this API should not be used. + Kafka, this API should not be used. To avoid re-processing the last + message read if a consumer is restarted, the committed offset should be + the next message your application should consume, i.e.: last_offset + 1. Blocks until either the commit succeeds or an unrecoverable error is encountered (in which case it is thrown to the caller). |