My python confluent kafka code to read from the Kafka broker looks as below
self.consumer = Consumer(
{
"auto.offset.reset": "earliest",
"enable.auto.commit": False,
}
)
while True:
msg = self.consumer.poll(timeout=5)
log.info(f"Before commit {msg.topic()} {msg.partition()}
{msg.offset()}")
#Before commit stream-seg 2 6476
self.consumer.commit(asynchronous=False)
log.info(f"After commit {msg.topic()} {msg.partition()}
{msg.offset()}")
#After commit stream-seg 2 6476
As seen above the msg.offset() before and after commit is same. Should I commit the offset value/partition also while doing the consumer.commit() or am I missing something