Skip to content
All projects

Replacing the ESB with a Kafka event platform in payments

Project write-up

The client is described by industry and scale, without a name. KPI figures are targets agreed with the client after a baseline measurement.

In brief

Problem
The ESB is a bottleneck: every new integration requires changes by a central team, and vendor support for the version in use is running out.
Approach
We run the migration using the strangler fig pattern.
Goal
API p99 latency: ≤ 300 ms; Lost or duplicated messages: 0 in resilience tests.

Client context

In banking, the cost of a production defect is measured not only in complaints but also in customer trust and supervisory findings. Since January 17, 2025, DORA has applied, moving the conversation about IT quality from the IT department to the board. The client is a universal bank with a complex system landscape: a transaction core, a card system, an AML module, online banking and several dozen integrations running through an ESB deployed more than a decade ago.

Challenge

The ESB is a bottleneck: every new integration requires changes by a central team, and vendor support for the version in use is running out. Batch processing delays payment information, so notifications and fraud monitoring run with a lag.

Requirements and constraints

  • DORA, the Digital Operational Resilience Act (Regulation (EU) 2022/2554), requires ICT risk management, a register of contracts with ICT providers, classification and reporting of major incidents, and regular testing of operational resilience. For the project this means every new component needs an owner, a dependency map and a resilience test scenario, and the provider (including us) goes into the register of information on contractual arrangements. (source)
  • Recommendation D of the KNF (Polish Financial Supervision Authority) sets out the supervisor's expectations for managing information technology and the security of the ICT environment in banks: separation of environments, change control, access management and business continuity. Every change in the system must go through a test and acceptance path that can be shown to an auditor. (source)
  • PSD2 and the RTS on strong customer authentication (SCA) require strong customer authentication, secure interfaces for third-party providers (TPPs) and transaction monitoring for fraud. Every change to a payment path requires tests of SCA exemptions and of API availability compliance. (source)
  • The Polish Anti-Money Laundering Act (AML) imposes an obligation to apply financial security measures, monitor transactions and report to the GIIF (Polish Financial Intelligence Unit). Rules and scoring models must be explainable and versioned, and every threshold change documented. (source)
  • Project constraints: work only on anonymized or synthetic data outside production, access to systems through the client's infrastructure, every deliverable handed over with documentation the client's team can take over.

Approach and architecture

We use the strangler fig pattern: new APIs gradually take over traffic from the old ESB, while an anti-corruption layer translates the old data model into the new one. This way the migration happens in pieces, with no big bang, and every step is reversible. Contract tests (consumer-driven) make sure a change on one side does not break the other.

We run the migration using the strangler fig pattern. First, payment events are published to Kafka in parallel (change data capture from the core), and new services, namely notifications and fraud monitoring, consume them in near real time. We then switch the remaining flows one by one, and the old bus is retired only after a parallel-run period with reconciliation.

Key elements of the solution:

  • CDC (Debezium) from the core database to Kafka topics with an Avro schema registry
  • Anti-corruption layer translating the old message model
  • Transactional outbox in the new services
  • Consumer lag monitoring and daily event reconciliation

Team and roles

RoleCountResponsibility
Solution architect1target architecture, ADR decisions, technical reviews
Integration engineer3API contracts, Kafka, ESB, contract tests
Backend developer (Java/Kotlin)3domain services, APIs, unit tests
Test analyst (ISTQB)2designing and executing cases, reporting defects
DevOps engineer1CI/CD pipeline, infrastructure as code
Scrum master1work rhythm, removing blockers, retrospectives
Product owner and domain experts (client side)as neededpriorities, business decisions, acceptance

Phased schedule

PhaseWeeksDeliverable
1. Integration inventory1–6flow map, interface catalog
2. Contract and platform design7–14API specifications, schema registry
3. Build and incremental migration15–30new interfaces, traffic cutovers
4. Contract and resilience testing31–36contract tests, failure scenarios
5. Decommissioning old connections37–40shutdown plan, documentation

Technology stack

Apache Kafka (Confluent Platform), Debezium, Schema Registry, Spring Boot, Kotlin, Kubernetes, Pact, Grafana.

Risks and how we mitigate them

RiskHow we mitigate it
Large number of integrations with unclear ownersintegration catalog with owners, contract tests, prioritization by criticality
Undocumented behavior of the old systemcharacterization tests (golden master) before the change, old versus new result comparisons
Message loss or duplication when switching flowstransactional outbox, idempotent consumers, daily reconciliation of events against the source
Service downtime during changesblue-green or canary deployments, feature flags, maintenance windows agreed with the business

Measurable goals and KPIs

The values below are targets that we set with the client after a baseline measurement in the first phase.

KPITargetHow it is measured
API p99 latency≤ 300 msAPM
Lost or duplicated messages0 in resilience testschaos tests, event reconciliation
Service availability≥ 99.9% per monthsynthetic monitoring, SLO
Lead time from change approval to production (DORA metrics)< 1 dayrepository and pipeline data

Lessons learned and good practices

A schema registry with compatibility rules matters more than the choice of broker, because it protects against silent consumer failures. A parallel-run period with automated reconciliation gives the business a peace of mind that no plan on paper can. Idempotency on the consumer side is cheaper than an exactly-once delivery guarantee.

Why B2B.net

We combine two models: we provide individual engineers and whole teams (time and materials, team leasing), and when a client prefers to hand over responsibility for the outcome, we work at a fixed price for a defined scope. We have access to a large network of engineers in six cities, SAP Center of Expertise competencies and experience with ISO 27001, DORA and NIS2 requirements. If someone leaves the team, a replacement is in place within 5 business days.

Next step

If you recognize these problems in your own organization, let's start with a short diagnosis: one workshop with your team and a written recommendation. Write to us: office@b2bnetwork.pl.

What would this look like for you?

Book a 30-minute call. We will prepare a plan for the first weeks and a team matched to your system.

Let's talk

B2Bnetwork · B2B.net S.A. · accredited exam center. We describe clients by industry and scale, without names.

More projects: Banking