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

Taught in

References

Certification courses