---
title: "KIP-98 explained: idempotent producer and transactions"
description: "KIP-98 in plain words: how Kafka stopped retries from writing duplicates and how transactions write to many partitions all or nothing. Status and follow-ups."
url: https://monedula.dev/kafka/kips/kip-98/
---

# KIP-98: exactly once with the idempotent producer and transactions

Producers and transactions · Shipped · since Kafka 0.11 · status checked November 2026.

KIP-98 gave Kafka two things. The idempotent producer lets the broker spot a retried batch and drop the copy, so a lost acknowledgement no longer means a duplicate. Transactions let a producer write to several partitions and commit or abort them together, so a read_committed consumer sees all of it or none.

## At a glance

- Proposal: KIP-98, Exactly Once Delivery and Transactional Messaging
- Status: Shipped. Since Kafka 0.11 (2017). Idempotence is on by default since Kafka 3.0.
- Area: Producers and transactions
- Proposal page: [KIP-98 on the Apache Kafka wiki](https://cwiki.apache.org/confluence/display/KAFKA/KIP-98+-+Exactly+Once+Delivery+and+Transactional+Messaging)

## Why it was needed

Before KIP-98, a producer that sent a batch and never heard back had two bad choices. Retry, and risk writing the same records twice if the first write had in fact succeeded. Or give up, and risk losing them. Stream processing made it worse: an app that reads, processes and writes could crash between writing its output and committing its input offsets, and on restart it would produce the same output again.

## What it changes

Every idempotent producer gets a producer id, and every batch it sends to a partition carries a sequence number. The broker remembers the last sequence numbers per producer and partition, so a retry of a batch it already has is acknowledged without a second write. Transactions build on that: a transactional.id ties the producer to a transaction coordinator, the producer marks which partitions it writes to, and commit or abort writes a marker into each of them. Consumers with isolation.level=read_committed only read up to the last stable offset, so they never see records of an open or aborted transaction.

## How to use it

- Idempotence needs nothing on Kafka 3.0 or newer: enable.idempotence=true and acks=all are the defaults.
- For transactions, set transactional.id on the producer and wrap sends in beginTransaction() and commitTransaction(); set isolation.level=read_committed on the consumers that must not see aborted data.

## Where it stands

Shipped in Apache Kafka 0.11 in 2017 and part of every release since. KIP-679 made idempotence the producer default in Kafka 3.0. Transactions stay opt-in, because they need a transactional.id and read_committed consumers.

## What comes next

The design keeps evolving through follow-up KIPs. KIP-447 made exactly-once stream processing scale, and KIP-890 hardened transactions on the broker side against hanging and zombie transactions: part one shipped in Kafka 3.6, and part two, a new transaction protocol that bumps the producer epoch on every transaction, is on once a cluster finishes its upgrade to Kafka 4.0.

## See it in the simulator

- [Kafka idempotent producer dedup vs a plain producer](https://monedula.dev/kafka-simulator/scenarios/idempotence-dedup/) (Idempotent dedup vs duplicate), step 3: Lost ack → p-idem re-sends seq 0 → DEDUPED (no second write). Idempotence: the broker recognises the already-committed sequence and acks without appending. Still one record. [Open at this step](https://monedula.dev/kafka-simulator/playground/?scenario=01.3.3&t=2)
- [Kafka transaction commit vs abort with read_committed](https://monedula.dev/kafka-simulator/scenarios/txn-commit-vs-abort/) (Transactional write: commit vs abort), step 7: abort · range skipped. abort_transaction records the range [2,4) in abortedRanges and releases the LSO PAST it to 4. The read_committed consumer advances its position over the range but delivers NONE of those records - the aborted batch is discarded. The HW advanced for both batches; only commit-vs-abort decided what is visible. [Open at this step](https://monedula.dev/kafka-simulator/playground/?scenario=04.2.1&t=6)
- [Kafka idempotent producer: retrying NOT_ENOUGH_REPLICAS](https://monedula.dev/kafka-simulator/scenarios/idempotence-retry/) (Idempotence retry), step 4: broker-2 back - the in-flight retry commits exactly once. No duplicate: the same record lands at offset 0 once the cluster heals. [Open at this step](https://monedula.dev/kafka-simulator/playground/?scenario=01.3.1&t=3)

## Sources

- [KIP-98: Exactly Once Delivery and Transactional Messaging](https://cwiki.apache.org/confluence/display/KAFKA/KIP-98+-+Exactly+Once+Delivery+and+Transactional+Messaging)
- [KIP-679: Producer will enable the strongest delivery guarantee by default](https://cwiki.apache.org/confluence/display/KAFKA/KIP-679%3A+Producer+will+enable+the+strongest+delivery+guarantee+by+default)

## Related KIPs

- [KIP-447 explained: exactly-once v2 for stream processing](https://monedula.dev/kafka/kips/kip-447/)
- [KIP-1123 explained: rack-aware producer partitioning](https://monedula.dev/kafka/kips/kip-1123/)
- [KIP-679 explained: acks=all and idempotence by default](https://monedula.dev/kafka/kips/kip-679/)
- [KIP-890 explained: transactions v2 and hanging transactions](https://monedula.dev/kafka/kips/kip-890/)
