Lakshya

Infrastructure & Reliability · Middleware — Messaging · Chapter 27 of 33

Real-time banking on messages: six flows, traced

A cross-border payment, a domestic high-value transfer, a channel talking to the core, a mainframe read model, a customer alert and a fraud score — each traced through the messaging layer, with what breaks in each and the controls that stop it.

9 min read2 diagramsAll 33 chapters

The previous chapters built the vocabulary. This one uses it. Six flows cover most of what a bank asks its messaging layer to do; for each, the question is the same: what must never happen, and which part of the middleware prevents it?

THE MESSAGING LAYER IN A BANK — COMMANDS ON QUEUES, EVENTS ON TOPICS Mobile & internet bankingBranch & operationsCorporate channelsPayments hub IBM MQ — queues commands, executed exactly once request/reply to the core Kafka — topics events, many readers kept for replay connectors, and change data capture from the core Core banking (CICS)SWIFT Alliance AccessRTGS / NEFT gatewayFraud scoringCustomer alertsAnalytics, read models Solid: commands that must be executed once. Dashed: facts that many systems want to know.
The shape most large banks have converged on. IBM MQ carries commands to systems of record — the core (often in CICS, the Customer Information Control System on the mainframe), SWIFT, the national payment gateways — where each must be executed exactly once. Kafka carries events outward to every system that wants to know what happened. Connectors and change data capture join the two.

Flow 1 — a cross-border payment over SWIFT

SWIFT is the cooperative network banks use to send each other payment instructions across borders. A bank connects to it through a gateway product, commonly SWIFT’s own Alliance Access, and SWIFT documents an MQ Host Adaptor through which the bank’s back office exchanges messages with Alliance Access over IBM MQ queues. The path is: payments hub → IBM MQ → Alliance Access → the SWIFT network → the correspondent bank.

The message format changed recently, and the change matters to middleware. ISO 20022 is an international standard for financial messages, carried as XML, with far richer structured data than the older SWIFT MT formats — full names and addresses in separate fields, purpose codes, remittance detail. On 22 November 2025 SWIFT ended the period in which the old and new formats coexisted for cross-border payment instructions: the MT103 customer transfer and MT202 bank transfer gave way to their ISO 20022 equivalents, pacs.008 and pacs.009, with a temporary SWIFT service converting stragglers’ old-format messages.

  • What breaks: duplicates after a failure and resend — SWIFT messages carry a possible-duplicate flag precisely because this happens; a payment held for sanctions screening that nobody releases; a cut-off missed because a queue backed up.
  • What the middleware must provide: persistent, exactly-once delivery to the gateway; message sizes large enough for ISO 20022’s richer content; and monitoring of the age of the oldest unsent payment against the cut-off, not just queue depth.

Flow 2 — a domestic high-value payment

In India, large payments go through RTGS — Real Time Gross Settlement, the Reserve Bank of India’s system that settles each payment individually and immediately in central bank money, available around the clock since December 2020. Smaller transfers go through NEFT, the National Electronic Funds Transfer, which settles in half-hourly batches. Banks connect through the SFMS gateway — the Structured Financial Messaging System built by the Institute for Development and Research in Banking Technology (IDRBT).

One fact surprises people who learnt ISO 20022 from the SWIFT migration: the RBI published ISO 20022 message formats for its next-generation RTGS in January 2013, with IDRBT building the mapping and a converter for banks, so India’s domestic high-value system moved to the standard more than a decade before SWIFT’s cross-border cut-over. The wider Indian payments landscape is in payments.

Flow 3 — a channel asks the core, and the reply is late

Mobile and internet banking talk to the core through request/reply over IBM MQ. It works until the core is slow — month-end, a batch overrunning, a lock on a busy account — and then it produces the most expensive bug in bank middleware.

THE COSTLIEST BUG IN REQUEST/REPLY: A TIMEOUT IS NOT A FAILURE CHANNEL APP CORE BANKING 0s1s2s3s4s5s6s7s8s debit request sent queued behind a month-end batch DEBIT APPLIED gives up at 5s: tells the customer “failed” reply arrives — nobody is listening retry DEBIT #2 WITHOUT AN IDEMPOTENCY KEY, THE RETRY IS A SECOND DEBIT. Every request carries a unique key the core remembers; after a timeout the channel ENQUIRES before it retries; and a process reconciles every reply that arrived to nobody. The timeout meant “unknown”, never “failed”.
The channel’s timeout means ‘I do not know’, and it is treated as ‘it failed’. The request was still on the queue; the core applied it after the channel had stopped listening. Every bank that runs request/reply needs all three controls in the box, and the third — reconciling orphaned replies — is the one usually missing.

Two further defences belong in the design. Give request messages an expiry no longer than the channel is prepared to wait, so a request the channel has abandoned is discarded rather than executed — appropriate for enquiries, dangerous for payments, where the enquire-before-retry rule is safer. And make the channel’s message to the customer honest: “we could not confirm your payment — please check before trying again” is a middleware decision surfacing in the user interface.

Flow 4 — reading from the mainframe without touching it

A large share of mobile-banking traffic is reads: balances, recent transactions. Serving every one from the core is slow and, on many mainframes, directly billed. The pattern that fixes it has two names worth knowing: change data capture (CDC), which reads a database’s own change log and publishes each change as an event, and CQRS, command query responsibility segregation — writes go to the system of record, reads are served from a separate copy built for reading.

The UK’s Nationwide Building Society described its version publicly as a Speed Layer: changes captured from its Unisys mainframe flow into Kafka, stream processing shapes them, and read-optimised stores serve the mobile app. Its first use case alone removed about 7 million requests a year from a mainframe charged per request, according to Computerworld’s reporting and Nationwide’s own conference talk. The catch, which the design must own: the copy is always slightly behind the core, so anything that decides money — whether a payment can go — must still ask the core.

Flow 5 — one event, many listeners

When a transaction posts, several systems need to know: the customer’s notification service, fraud, the loyalty programme, analytics. Wiring each to the core separately multiplies load and coupling. Publishing one “transaction posted” event to a topic, and letting each system subscribe, is the answer. Rabobank describes its version on the Apache Kafka project’s own list of users: a Business Event Bus on Kafka that powers, among other things, its customer alerts service, Rabo Alerts.

Flow 6 — scoring fraud while the payment waits

A card authorisation travels over the card network and the bank’s switch, not over IBM MQ — the switch is described in payments. But the fraud decision increasingly depends on a stream of recent events: where the card was used an hour ago, how many attempts in the last minute. Those features are computed continuously from Kafka topics so the scoring model can answer within the authorisation’s tight time budget.

The middleware question is a policy question in disguise: if the scorer is slow or down, does the payment fail open or fail closed? Approving without a score risks fraud losses; declining risks turning away every customer at once. The answer is the business’s to make, and must be written down before the first incident rather than improvised during it.

A note on trading floors

Capital markets use messaging differently: market data is published to thousands of subscribers and microseconds matter. That world grew its own products — TIBCO Rendezvous historically, and Solace, founded in 2001 to build messaging hardware appliances for capital markets, whose product is now Solace PubSub+. The exchange side is in trading and exchanges.

The controls every flow needs

ControlWhat it isWhich failure it prevents
Idempotency keysA unique business identifier on every instruction, remembered by the receiverDouble execution after a retry, a resend or a redelivery
Order per accountAll messages for one account processed in sequenceA debit overtaking a credit and bouncing a payment
An owned dead-letter queueA named team, an alert when it is not empty, a procedure for every messagePayments delivered perfectly and never processed
ReconciliationEnd-of-day comparison of what was sent, received and posted — counts and valuesSilent loss or duplication that no alert saw
Age-based alertingOldest-message age and consumer lag against cut-off timesA queue that is small, stuck, and about to miss a scheme deadline
Peak capacityBuffer and throughput sized for salary day and month-end, not an average TuesdayQueues filling to maximum depth on the days that matter most

Check yourself

What connects a bank's back office to SWIFT Alliance Access over IBM MQ?SWIFT's MQ Host Adaptor, which exchanges messages with Alliance Access through MQ queues.
What changed on 22 November 2025?SWIFT ended MT/ISO 20022 coexistence for cross-border payment instructions: MT103 and MT202 gave way to pacs.008 and pacs.009.
What is ISO 20022, and why does it matter to middleware?An international XML standard for financial messages with richer structured data — larger messages, new formats to route and validate.
Expand RTGS, NEFT and SFMS.Real Time Gross Settlement; National Electronic Funds Transfer; Structured Financial Messaging System, built by IDRBT.
When did India's RTGS adopt ISO 20022 formats?The RBI published them for next-generation RTGS in January 2013 — over a decade before SWIFT's cross-border cut-over.
Why is a timeout not a failure?The request may still be queued and executed later; the true state is 'unknown', so the channel must enquire before retrying and orphaned replies must be reconciled.
What are CDC and CQRS?Change data capture publishes each database change as an event; command query responsibility segregation serves reads from a separate copy while writes go to the system of record.
What did Nationwide's Speed Layer save?About 7 million requests a year from a per-request-charged mainframe in its first use case, by serving reads from a Kafka-fed copy.
What must a read model never decide?Anything involving money movement — the copy is slightly behind the core.
Fail open or fail closed when fraud scoring is down?A business policy decision, to be written down before the first incident.
Name six controls every messaging flow needs.Idempotency keys, order per account, an owned dead-letter queue, reconciliation, age-based alerting and peak capacity.
← Kafka and IBM MQ: a log is not a queueThe broker market: products, clouds, and the infrastructure under them →