
Kafka Inbox/Outbox in Go — Guaranteeing Exactly-Once Delivery in a Multi-Tenant ERP
Kafka Inbox/Outbox in Go — Guaranteeing Exactly-Once Delivery in a Multi-Tenant ERP The Problem In a multi-tenant ERP handling concurrent stock and order updates, duplicate event processing is not a theoretical risk — it is a production reality. In our system at Gononet, duplicate events happened for two reasons: Network retries — a message is delivered but the consumer crashes before committing the offset. Kafka re-delivers it. Double-submit orders — a user clicks "confirm order" twice due to slow network. Two events hit the queue simultaneously. The result? Stock deducted twice. Orders created twice. Inventory counts wrong. In a warehouse system, this is a critical failure. We needed exactly-once delivery. This is how we built it. Why Not Just Use Kafka Transactions? Kafka transactions guarantee exactly-once delivery within Kafka itself — producer to broker. But our problem was on the consumer side. We needed to guarantee that our business logic — stock deduction, ledger insert — exe
Continue reading on Dev.to
Opens in a new tab



