The hard problem
Networks retry, so a producer may send the same record twice and a consumer may reprocess after a crash. Exactly once means each record affects the result a single time despite these failures.
Idempotent producer
Kafka gives each producer a producer id and a sequence number per partition. The broker drops duplicates with a sequence it has already seen, so a retried send does not write the record twice.
Transactions tie steps together
For a read process write pipeline, Kafka transactions let a consumer commit its input offsets and its output records atomically. Either both commit or neither does, so the output and the consumed position stay consistent.
Read committed isolation
Downstream consumers set isolation to read committed, so they only see records from transactions that fully committed. Aborted records stay hidden.
The honest caveat
This covers Kafka to Kafka flows. A side effect to an external system, like a payment call, still needs idempotency there, since Kafka cannot roll it back.
Key idea
Idempotent producers drop duplicate writes and transactions commit offsets and outputs atomically, giving effectively once processing for Kafka to Kafka pipelines.