True exactly-once requires idempotent consumers with deduplication stored in the DB, the transactional outbox pattern for producing events, and Kafka consumer group offset commits tied to successful processing.
Idempotent consumer: processed_events table with UNIQUE(event_id) — ON CONFLICT DO NOTHING skips duplicates
Transactional outbox: write event and state change in same DB transaction — relay publishes to Kafka separately
Commit offsets only after successful DB write — ensures re-processing on failure
Kafka transactions + transactional producers for Kafka-to-Kafka pipelines (not DB sinks)
segmentio/kafka-go or confluent-kafka-go for production Kafka consumers in Go