Posts

Showing posts from May, 2026

How auto.offset.commit works in kafaka?

 Summary point from the article then my understanding explanation: https://www.confluent.io/learn/kafka-auto-reset/#how-apache-kafka-handles-consumer-offsets - Each Kafka consumer group maintains its own offsets, which Kafka stores in a special topic called “__consumer_offsets”. - Kafka consumers commit offsets? here is why? https://syedblog61220.blogspot.com/2026/05/kafka-consumers-commit-offsets-here-is.html -  

Kafka consumers commit offsets? here is why?

 Kafka consumers commit offsets to track their progress in a topic. This "bookmark" tells Kafka which messages have been successfully processed, ensuring that if a consumer restarts or a rebalance occurs, it knows exactly where to pick back up.  Internally, these offsets are stored in a special, compacted internal topic named __consumer_offsets.  1.⁠ ⁠Automatic Commit (Default) By default, the consumer is configured to commit offsets automatically.  How it works: When enable.auto.commit is set to true, the consumer automatically commits the largest offset returned by the poll() method at a fixed interval. (When you call poll(), Kafka doesn't just give you one message; it gives you a batch of messages (e.g., 500 messages at once). The consumer tracks your progress by the highest number in that batch.) Frequency: Controlled by auto.commit.interval.ms (default is 5000ms or 5 seconds). Risk: This is the easiest method but can lead to data loss (if the consumer crashes af...

Manual Offset commit by consumer

 https://www.baeldung.com/kafka-commit-offsets

What are consumer groups in Kafka and Why do we need it.

Prompt: So why do we create consumer group in Kafka? Basically, we have a consumer group and each consumer assigned to one partition. So what happens is, we have topics on which the consumer is subscribed to. And if the topic is in one consumer group, so for example, there is a topic 1 in consumer group 1. So if there are three topics in that consumer group 1, so either of them, one of them will receive the message the producer produced to that consumer group. But if we have different consumer groups, so each of them will receive that message on their topic, either the topic, for example, if we have group 1, group 2, group 3, and in each group, we have topic 1, topic 1, topic 1. So when producer send the message, it will go to each group and each topic. But when we have the consumer group, single consumer group, and all topic 1 replicates itself three times, it will be sent to one of the topics. Okay, am I correct? Make an article on that with this same example and give me copy-paste c...