summaryrefslogtreecommitdiff
path: root/kafka/consumer/kafka.py
diff options
context:
space:
mode:
Diffstat (limited to 'kafka/consumer/kafka.py')
-rw-r--r--kafka/consumer/kafka.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/kafka/consumer/kafka.py b/kafka/consumer/kafka.py
index cd3cc4a..53ba0a7 100644
--- a/kafka/consumer/kafka.py
+++ b/kafka/consumer/kafka.py
@@ -430,6 +430,10 @@ class KafkaConsumer(object):
offset, message.key,
self._config['deserializer_class'](message.value))
+ if offset < self._offsets.fetch[topic_partition]:
+ logger.debug('Skipping message %s because its offset is less than the consumer offset',
+ msg)
+ continue
# Only increment fetch offset if we safely got the message and deserialized
self._offsets.fetch[topic_partition] = offset + 1