Skip to main content
PreparationZone Logo
PrepZone

Idempotent Producer and Sequence Numbers

enable.idempotence=true prevents duplicate writes on retry — essential before VaultCommerce enables transactions.

Pass checkpoint below

Why this matters

  • Prerequisite for Kafka transactions and EOS pipelines at VaultCommerce.
  • enable.idempotence=true sets safe defaults: acks=all, retries>0, max.in.flight=5.
  • Without idempotence, network retries after timeout create duplicate order events.
  • PID (producer id) persists for transactional.id lifetime — don't recycle randomly.
acks=0
No wait
May loseFire and forget
acks=1
Leader ack
Leader crash risk
acks=all
ISR ack
DurableProduction
acks=0 is fastest but may lose data. acks=all waits for all ISR replicas — production default.

Sequence numbers and PID

On first send to a partition, broker assigns a producer ID (PID). Each message gets a monotonic sequence per PID-partition pair. If broker sees duplicate sequence, it acks without appending. VaultCommerce enables idempotence on every production producer.

Key points

  • enable.idempotence — turns on PID and sequence dedup at broker
  • Producer ID (PID) — broker-assigned identifier per producer instance
  • Sequence number — per-partition ordering of sends from one PID
  • max.in.flight.requests.per.connection=5 — safe with idempotence (was 1 pre-KIP-98)
  • Transactional producer — extends idempotence with transaction coordinator

The rest of this guide is part of Pro

Free covers every fresher guide in full. Pro unlocks Senior, Staff and Architect guides across every track.

Still to come · 2 sections

  • Limits and scope
  • VaultCommerce rollout checklist

Test yourself

Answer these before moving on — recall is what makes it stick.