- Payment gateways (cards, UPI, QR-code scans)
- Online banking operations (web, mobile)
- ATM withdrawals and deposits
A topic is a logical stream of similar events (for example,
transactions). Producers write events to the topic, and multiple consumers or stream processors can read and react to the same stream independently.- Producers (payment gateways, banking systems, ATMs) publish transaction events to a Kafka topic (for example,
transactions). - Multiple consumers or stream processors subscribe to that topic and perform separate tasks in parallel:
- Compliance service: validates transactions against regulatory and internal policies.
- Fraud detection service: runs real-time scoring and anomaly detection to flag suspicious behavior.
- Account-update service: applies the transaction to account balances and emits confirmation events.
- After processing, services may publish derived events to other topics (for example,
account-updates,fraud-alerts,exceptions), which downstream consumers (notifications, ledgers, analytics) use to complete the workflow.

- A payment gateway produces a transaction event to the
transactionstopic. - Fraud detection consumes the event and scores it; if suspicious, it emits an alert to
fraud-alertsor triggers a workflow to place a hold. - Compliance consumes the same event and, if needed, writes to
exceptionsorholds. - Account-update processor consumes
transactions, updates balances, and writes a confirmation event toaccount-updates. - Notification service consumes
account-updatesand sends a real-time SMS/push notification to the customer.
Production considerations
Exactly-once semantics in distributed systems is complex. Use Kafka transactions and idempotent producers carefully and test end-to-end to ensure balance updates and compliance checks remain correct under failures.
- Durable, ordered event storage for audit and replay
- Multiple independent consumers can process the same stream without interfering
- High throughput and low latency with partitioning and parallel consumers
- Ease of scaling and adding new consumers (analytics, auditing) without changing producers
- Event Streaming with Kafka (course)
- ksqlDB — Streaming SQL for Kafka
- Kafka Streams
- Apache Kafka documentation