Most teams running a Kafka-based payment platform eventually have the same conversation after a production incident: “the consumer restarted and processed the same payment twice.” The post-incident report calls it a race condition, or a timing issue, or sometimes, vaguely, “a message broker anomaly.” It is none of those things. It is a predictable consequence of how distributed systems handle failure, and preventing it requires a set of architecture and policy decisions that only leadership can make.
Engineers can implement idempotency controls with precision. What they cannot do, without direction from above, is define the scope of the problem, set the retry policies that determine how often duplicates occur, decide the data retention windows that determine how long the deduplication layer must remember, or establish the operational runbook that governs what happens when the deduplication layer itself fails. Each of those is a business decision that wears an engineering shape.
What “at-least-once” actually means for a bank
Message brokers like Kafka guarantee that messages are delivered at least once. The only way to guarantee messages are delivered exactly once is to either make the delivery mechanism transactional with the processing state (which Kafka supports in limited topologies) or to make the consumer idempotent: able to receive the same message multiple times and produce the same result as if it had been received once. The second approach is more general and more durable, but it requires that every consumer in the payment pipeline—not just the critical path—implements it correctly.
The frequency of duplicates is low in a healthy system. In a system undergoing a deployment, a network partition, or an infrastructure migration—the conditions that routinely occur in a bank—the rate can be orders of magnitude higher for a short window. Banks measure payment volumes in the hundreds of thousands per day. Even a 1% duplicate rate during a 30-minute incident window is hundreds of payments. That is the scope of the problem that leadership needs to hold.
The question is not whether your payment pipeline produces duplicates. Under failure conditions, it does. The question is whether your consumers detect and suppress them before the business effect reaches the customer or the regulator.
The decisions that belong at VP level
The retry policy is a business risk decision, not an engineering tuning parameter. Every Kafka producer has a retry count and a delivery timeout. Higher retries mean higher durability—the payment is less likely to be lost. They also mean higher duplicate rates under failure conditions, because each retry that reaches the broker but fails to return an acknowledgement produces a second copy of the message. The setting that eliminates broker-side duplicates (idempotent producer mode, enabled with a single configuration flag) should be mandatory for any producer that touches payment data. Making it mandatory is a governance decision that belongs in the platform team’s engineering standards, signed off at the VP level, not left to individual squad discretion.
The deduplication retention window must be longer than any credible incident window. An idempotency table records which event IDs have been processed. For it to catch duplicates, it must retain records for at least as long as a message can be redelivered. In Kafka, the redelivery window is bounded by the topic’s retention period. A topic configured to retain messages for 7 days means a consumer reset can deliver 7-day-old messages. If the idempotency table purges records after 48 hours, a replay of last week’s events will bypass deduplication entirely. Aligning the retention window requires a decision about the maximum credible recovery scenario—that is a risk appetite question, not a database capacity question.
The UETR is the authoritative deduplication key for SARIE payments, and its use must be governed. ISO 20022 defines the Unique End-to-End Transaction Reference (UETR) as a persistent identifier that must remain unchanged across every processing hop of a payment. End-to-end tracking across schemes that have moved to ISO 20022 increasingly depends on it. Using the UETR as the deduplication key is technically straightforward. Ensuring that every system in the payment chain—core banking, payment hub, SWIFT gateway, reporting layer—correctly propagates the UETR without modification is an integration governance requirement that the VP of integration owns, not a detail that can be left to each system’s team to interpret independently.
What the regulator will look for
Payment processing integrity is one of the first things a SAMA examination looks at. Examiners will typically ask for three things in this area. First, evidence that the bank has a documented control that prevents duplicate payment execution—not just a claim that the pipeline is reliable. Second, the test results that validate the control works under failure conditions: consumer restart, broker failover, manual offset reset. Third, the incident record for any payment duplication event in the examination window: how it was detected, how quickly, what was the customer impact, and how the root cause was remediated.
A bank that has idempotency controls that were never tested under failure conditions, or that were added after the first incident rather than before go-live, is in a weaker examination position than one that can demonstrate proactive control design. The time to establish that design is before the payment platform goes into production, not after the first duplicate debit.
What leadership can do to unblock the team
Three practical actions that a VP can take immediately to accelerate correct idempotency implementation:
The first is to mandate idempotent producer configuration as a platform standard and include it in the integration team’s definition of done for any new Kafka producer. This single change prevents an entire class of broker-side duplicates with no performance cost. The engineering team should not have to make a case for this per squad, per project.
The second is to define the deduplication retention window as a named policy in the integration governance framework. “Idempotency records are retained for 7 days, aligned with the payment topic retention period.” That sentence, in a documented standard, removes an ambiguity that currently resolves differently in every squad that builds a payment consumer. Inconsistency in the deduplication window is itself a gap that the regulator will note.
The third is to schedule a failure mode test—ideally in a production-equivalent environment—that validates the deduplication layer under the three conditions that most commonly produce duplicates in production: consumer group restart, Kafka broker leader failover, and manual offset reset. The test does not need to be elaborate. It needs to produce a documented result that can be presented as evidence of a functioning control. Without that evidence, the control exists only on paper.
For the full implementation: database idempotency tables with atomic ON CONFLICT, Redis SET NX deduplication, Kafka exactly-once semantics configuration, ISO 20022 UETR as the key, and monitoring configuration — see the companion Lab article: Idempotent Consumers & Exactly-Once Semantics: Payment Deduplication at Scale.