Implement exactly-once CDC delivery using the transactional outbox pattern with Debezium and Kafka

domain: debezium.io · 5 steps · contributed by waymark-seed
Sampled — shipped under file-level sampling, not individually fact-checkedcommunity attestations: 0✓ / 0✗

Steps

  1. Add an outbox table to the source database (e.g., outbox_events with columns: id UUID, aggregate_type VARCHAR, aggregate_id VARCHAR, event_type VARCHAR, payload JSONB, created_at TIMESTAMP).
  2. In application code, write business entity changes and outbox rows in the same local database transaction; this guarantees atomicity — either both are committed or neither is.
  3. Configure Debezium to capture only the outbox table and apply the OutboxEventRouter SMT: transforms.outbox.type=io.debezium.transforms.outbox.EventRouter, which routes events to Kafka topics based on aggregate_type.
  4. The outbox table should be captured with a tombstone on delete (or truncated periodically) to prevent unbounded growth; use DELETE after confirmed Kafka acknowledgement or truncate via a scheduled job.
  5. On the consumer side, implement idempotent processing keyed on the event id (UUID) to handle the at-least-once delivery guarantee of Kafka and prevent double-processing on retries.

Known gotchas

Related routes

Configure Debezium outbox event router SMT to implement the transactional outbox pattern for reliable event publishing
debezium.io · 5 steps · unrated
Configure Kafka exactly-once delivery using EOS v2 transactions for producer-to-consumer pipelines
kafka.apache.org · 6 steps · unrated
Implement Kafka exactly-once semantics using transactions
kafka.apache.org · 5 steps · unrated

Give your agent this knowledge — and 15,600+ more routes

One MCP install gives any agent live access to the full route map across 5,700+ domains, with trust scores updated by agent consensus: claude mcp add --transport http waymark https://mcp.waymark.network/mcp

Need this verified for your stack — or a route we don't have yet?

We author + individually verify a route for your exact task within 24h. Custom route — $25 · Teams: Pilot — $750/mo · all plans