I am using Kafka python version 2.0.2 to Produce and consume messages: My producer :
from kafka import KafkaProducer
producer = KafkaProducer(bootstrap_servers='my server')
producer.send('my topic', b'hello word')
my consumer :
consumer = kafka.KafkaConsumer('my topic',bootstrap_servers=['192.168.2.137:9092'],
auto_offset_reset='earliest',
enable_auto_commit=True,
group_id='name')
for message in consumer:
print(message.value)
when I run the consumer it works just fine. But when I stop it before it finishes all messages it don't continue from where I stopped, What if my program crashes or my laptop out of battery? how can I solve this each I want the consumer to continue read un readed messages?