Kafka transaction
A group of writes, possibly across several partitions and topics, that Kafka makes visible all together on commit or not at all on abort.
In more detail
A transactional producer calls init_transactions once, then begin_transaction, sends its records and finishes with commit_transaction or abort_transaction. Consumers using read_committed never see records from aborted transactions. Transactions can also include consumer offset commits, which is the basis of exactly-once processing.
Example
producer.init_transactions(); producer.begin_transaction(); producer.send(...); producer.commit_transaction()Related terms
- transactional.id — A stable name you give a transactional producer so the broker can recognise it across restarts.
- isolation.level — The consumer setting that decides whether records from open or aborted transactions are returned: read_uncommitted or read_committed.
- commit marker — A special record the broker writes into each partition of a transaction to mark it as committed or aborted.
- exactly-once semantics — A guarantee that each message's effects happen exactly once, even when senders retry or consumers crash.
- transaction — A group of database changes that succeed or fail together, so the data is never left half-updated.
Taught in
- The Retry That Overtook — Confluent Apache Kafka Certifications (CCDAK and CCAAK) Exam Prep
- Two Copies Of One Service — Confluent Apache Kafka Certifications (CCDAK and CCAAK) Exam Prep
- Allowed To Read, Refused Anyway — Confluent Apache Kafka Certifications (CCDAK and CCAAK) Exam Prep
- Seventy One Percent — Confluent Apache Kafka Certifications (CCDAK and CCAAK) Exam Prep
- Transactions And Exactly Once Semantics — Apache Kafka & Event Streaming