From the course: Complete Guide to Apache Kafka for Beginners
Unlock the full course today
Join today to access over 25,200 courses taught by industry experts.
Idempotent producer - Kafka Tutorial
From the course: Complete Guide to Apache Kafka for Beginners
Idempotent producer
So let's review what is an idempotent producer. So when a producer is sending data into Apache Kafka, there can be duplicate messages due to network errors. So let's have an example. Here is what a good request looks like. We produced data into Apache Kafka. Apache Kafka commits the data into the log and Apache Kafka sends back an acknowledgment to our producer. From that point onwards, all good, right? But what if we have a bad request or duplicate request. What happens? We produce data to Kafka. Kafka commits the messages on the log and sends back an ack. But this ack never reaches our producer maybe because of a network error. Therefore, the producer never receives an ack and say this is weird. I'm going to retry my produce because we have a retry setting, right? So the produce is retried. Kafka sees it as a new request, so it will commit a duplicate message and then sends back the ack. So from a producer…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
-
-
-
-
-
(Locked)
Wikimedia producer project setup6m 25s
-
(Locked)
Wikimedia producer implementation11m 54s
-
(Locked)
Wikimedia producer run2m 40s
-
Wikimedia producer: Producer config intros45s
-
(Locked)
Producer acknowledgments deep dive8m 48s
-
(Locked)
Producer retries3m 3s
-
(Locked)
Idempotent producer2m 52s
-
(Locked)
Safe Kafka producer settings1m 59s
-
(Locked)
Wikimedia producer safe producer implementation4m 3s
-
(Locked)
Kafka message compression4m 47s
-
(Locked)
linger.ms and batch.size producer settings3m 23s
-
(Locked)
Wikimedia producer high-throughput implementation3m 16s
-
(Locked)
Producer default partitioner and sticky partitioner4m 18s
-
(Locked)
[Advanced] max.block.ms and buffer.memory2m 39s
-
(Locked)
-
-
-
-
-
-