MeshGate
2023 – 2024Backend Engineer
A production-ready microservices platform demonstrating distributed systems fundamentals — service discovery, API gateway routing, asynchronous event-driven workflows, and idempotent message processing. Six independent Spring Boot services communicate via REST and RabbitMQ, deployed behind Nginx.
KEY METRIC
6 microservices, 3 infrastructure containers, exactly-once message processing via Outbox pattern
Stack
Overview
MeshGate follows a classic API Gateway + Service Discovery pattern. Nginx proxies incoming traffic to Spring Cloud Gateway, which routes requests dynamically to registered microservices via Netflix Eureka.
User registration triggers a RabbitMQ event broadcast — the auth service publishes a UserRegisteredEvent and immediately returns an HTTP response. Billing and notification services consume the event asynchronously, initializing subscription context and dispatching welcome notifications without blocking the critical auth path.
Architecture
System architecture overview
Technical Challenges
Idempotent Message Processing
RabbitMQ redelivers messages on network partitions, risking duplicate billing records. Implemented the Outbox pattern with a ProcessedEventRepository — before acting on any event, services check for a REG-<AuthId> deduplication key and commit it only after successful processing.
Centralized CORS Without Annotation Drift
Applying @CrossOrigin to every controller is a maintenance trap. Implemented global CORS policy at the Spring Cloud Gateway edge using CorsWebFilter — microservices are completely abstracted from browser preflight logic.
Avoiding Synchronous Orchestration Chains
Synchronous REST calls between auth, billing, and notification services create chained timeout risks and reduced availability. Replaced the entire onboarding flow with RabbitMQ pub/sub — auth responds immediately while downstream services operate independently.