Skip to main content
PreparationZone Logo
PrepZone

Committed Offsets and auto.offset.reset

Where each VaultCommerce consumer group resumes after restart — committed offsets and reset policies.

Pass checkpoint below

Why this matters

  • VaultCommerce disables auto-commit — offsets commit only after inventory reservation succeeds in Postgres.
  • auto.offset.reset=earliest on new groups replays history; latest skips backlog.
  • Wrong commit timing is the #1 cause of duplicate or missed processing.
  • Offset tools are essential for incident recovery and reprocessing.
Poll records
Business logic
Offset +1
Process batch → commit offset. On restart, consumer resumes from last committed position.

Commit strategies

Sync commit after each record: safe, slow. Batch commit every N records: faster, riskier on crash. VaultCommerce commits per record on payment topics, every 100 on analytics. commitSync() blocks until broker acks offset.

Key points

  • Committed offset — next record to read on restart
  • auto.offset.reset — behavior when no committed offset exists (earliest/latest/none)
  • enable.auto.commit — periodic background commit (default true; VaultCommerce sets false)
  • __consumer_offsets — internal compacted topic storing commits
  • seek() — programmatic offset jump for testing or recovery

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

  • Reset and replay
  • VaultCommerce rollout checklist

Test yourself

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