August 2026 · Java 26 · Spring Boot 4.1 · Kafka
Spring Boot Rube Goldberg Platform — Event-Driven Microservices
A production-grade, event-driven restaurant reservation platform demonstrating extreme concurrency handling, CQRS with Redis, Transactional Outbox on Kafka, and fair FIFO matchmaking in Java 26.
The Real-World Dilemma: High-Concurrency Dining Logistics
Modern reservation platforms face unique distributed systems challenges where sub-second latency and strict consistency collide:
- Extreme Concurrency & Double-Booking Risk: Peak dining slots generate simultaneous booking requests that require deterministic, atomic table allocation without race conditions.
- Dynamic Combinable Physical Inventory: Tables must serve single parties or combine physically (e.g. Table 1 + Table 2) to accommodate larger group sizes dynamically.
- Sub-50ms Discovery vs. Authoritative Consistency: Slot searches must be blazingly fast via Redis read projections, while booking mutations require strict ACID guarantees in PostgreSQL.
- Fair Demand Management (FIFO Waitlist): When cancellations occur, freed capacity must not trigger a public scramble; instead, it is offered fairly to the oldest matching candidate on a FIFO waiting list with time-limited (15-minute) hold windows.
Why the “Rube Goldberg” Metaphor?
In distributed engineering, a Rube Goldberg machine represents a complex, choreographed chain reaction set in motion by a single trigger. On this platform, a single customer action (such as confirming or cancelling a reservation) triggers an automated, decoupled cascade across the entire ecosystem:
- 1. ACID Transaction & Local Outbox: The
reservation-serviceallocates tables atomically and records an event into the localoutbox_eventstable within the same database transaction. - 2. Reliable Kafka Dispatch: A background outbox poller publishes the event to Apache Kafka (
reservation.events) with at-least-once delivery guarantees. - 3. Read Projection Cache Invalidation: The
availability-serviceconsumes the event and instantly invalidates/evicts stale slot projections in Redis. - 4. Fair FIFO Matchmaking: On cancellation, the
waiting-list-servicedetects freed inventory and automatically generates a 15-minute claim offer for the next candidate in line. - 5. Decoupled Notifications & Analytics: The
notification-servicedelivers formatted emails via SMTP, while theanalytics-servicecomputes real-time conversion and occupancy metrics asynchronously.
Microservices Reactor & Infrastructure
The platform is organized as a standard Maven Reactor multi-module architecture comprising 8 specialized services and supporting infrastructure:
- API Gateway (Port 8080): Spring Cloud Gateway with distributed Redis rate limiting and lightweight browser portals.
- Customer Service (Port 8082): Customer profiles and Keycloak OIDC identity integration.
- Restaurant Service (Port 8083): Establishment profiles, operating shifts, and physical table combination topologies.
- Availability Service (Port 8084): CQRS read model projections cached in Redis for sub-50ms query latency.
- Reservation Service (Port 8085): Authoritative table allocation engine and Transactional Outbox publisher.
- Waiting List Service (Port 8086): Fair FIFO waitlist matchmaker with time-limited reservation hold offers.
- Analytics Service (Port 8087): Real-time event aggregation and dining conversion metrics.
- Notification Service (Port 8088): Asynchronous email delivery (Mailpit) and 24-hour reservation reminder schedulers.
Key Architectural Patterns & Technologies
The platform serves as a reference implementation for modern Java 26 and Spring Boot 4.1 enterprise patterns:
- Virtual Threads (Project Loom): Enabled across all services via
spring.threads.virtual.enabled=true, allowing high-throughput blocking JPA/JDBC queries without thread-pool exhaustion. - Transactional Outbox Pattern: Eliminates dual-write anomalies by persisting business state and Kafka events inside a single database transaction.
- Idempotent Event Consumers: Consumers track processed
event_idkeys in dedicated tables to safely handle duplicate message deliveries. - Deterministic Allocation Algorithm: Evaluates single tables first (selecting the smallest optimal fit) before evaluating physical table combination rules.
- RFC 9457 Problem Details: Standardized error responses formatted as
application/problem+jsonacross all REST endpoints. - Interactive OpenAPI & Swagger UI: Automated endpoint documentation exposed across every microservice via SpringDoc.
The Repository
The complete 8-service Maven Reactor project, Docker Compose stack, OpenAPI specifications, and Kubernetes manifests are available on GitHub:
github.com/lazarius-borg/springboot_rube_goldberg
Engineered with Java 26, Spring Boot 4.1.1, Spring Cloud 2024, Apache Kafka 3.9, Redis 7, PostgreSQL 17, and Keycloak 26.