MIDDLEWARE
CBS Middleware v2
A resilient middleware layer between digital channels and two core banking back-ends.
- Channel
- Controller
- Pipeline behaviours
- Handler
- Anti-corruption layer
- Core back-end
The problem
// ContextChannels such as internet banking, mobile, agents and payment networks all needed a single, consistent way to reach the core banking systems. The legacy middleware was a monolith with logic tangled into transport code, which made every change risky.
Approach
// What I built- Clean Architecture with five projects: API, Application (CQRS with MediatR), Domain, Infrastructure and Persistence.
- An anti-corruption layer wraps each back-end. SOAP gateways share a template-method base class and declarative response mapping, so no vendor type leaks above Infrastructure.
- Pipeline behaviours handle logging, validation, idempotency, deadlines and performance in one place.
- Oracle access goes through a package executor decorated with a Polly circuit breaker.
- Architecture tests enforce the rules: layering, the ACL boundary, no raw SQL outside Persistence, and a validator for every mutating command.
Decisions and trade-offs
// Why it is built this wayWire-format attributes live in Domain
Application DTOs can be annotated without referencing Infrastructure, and an architecture test keeps it that way.
One package executor for Oracle
Every database call passes through a single decorated executor, so circuit breaking and request auditing sit in one place.
Copy unverifiable constants verbatim
Product and segment codes that cannot be verified independently were kept exactly as in the legacy code and isolated in one handler.
Outcomes
// Result- All 34 legacy SOAP operations ported with the same business logic and cleaner plumbing.
- 565 automated tests passing, including architecture tests.
- Fixed a legacy correctness bug found during migration, where a tracking write and an approval chain ran unconditionally.