August 2026 · Java 26 · Spring Boot 4.1.1 · Kafka 3.9 · Keycloak 26 · OpenTelemetry

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, Keycloak OIDC security, an OpenTelemetry observability pipeline, and Kubernetes deployment readiness in Java 26.

The Rube Goldberg name for the project was chosen as a metaphor for a system that was deliberately overengineered to showcase use of diverse technologies available in SpringBoot, that could otherwise have been implemented as a monolith or modulith. Started as a demonstration project, it keeps on evolving and may one day get the ambition of becoming a SaaS project. The rest of the article was written by the same model that generated the code.

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: Simultaneous booking requests for peak time slots must guarantee deterministic, atomic table allocation without race conditions.
  • Dynamic Combinable Physical Inventory: Tables can serve individuals or combine physically (e.g., Table 1 + Table 2) to accommodate larger parties.
  • Sub-50ms Discovery vs. Authoritative Consistency: Search operations must be blazingly fast (via Redis read projections) while booking mutations must be strictly consistent and ACID-compliant.
  • Fair Demand Management (FIFO Waitlist): When cancellations occur, freed slots must not trigger an unfair public “race condition”; instead, they must be offered fairly to the oldest matching candidate on a FIFO waiting list with time-limited (15-minute) expirations.
  • Decoupled Reliability: Notifications and operational analytics must never degrade core reservation transaction latency or reliability.

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-service allocates tables atomically and records an event into the local outbox_events table 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-service consumes the event and instantly invalidates/evicts stale slot projections in Redis.
  • 4. Fair FIFO Matchmaking: On cancellation, the waiting-list-service detects freed inventory and automatically generates a 15-minute claim offer for the oldest matching candidate in line.
  • 5. Decoupled Notifications & Analytics: The notification-service delivers templated emails via Mailpit SMTP, while the analytics-service computes real-time conversion and occupancy KPIs asynchronously.

Microservices Reactor & Infrastructure

The platform is organized as a standard Maven Reactor multi-module architecture comprising 8 specialized services, lightweight web portals, and supporting cloud-native infrastructure:

  • API Gateway (Port 8080): Spring Cloud Gateway with distributed Redis rate limiting and built-in responsive web portals (Customer & Manager Portals).
  • Customer Service (Port 8082): Customer profiles and Keycloak OIDC identity mapping with RFC 9457 validation.
  • Restaurant Service (Port 8083): Establishment profiles, operating shifts, and dynamic physical table combination topologies.
  • Availability Service (Port 8084): CQRS read model projections cached in Redis for sub-50ms query latency, with strongly-typed model attribute query binding.
  • Reservation Service (Port 8085): Authoritative table allocation engine, Transactional Outbox publisher, and snapshotted cancellation policy enforcement.
  • Waiting List Service (Port 8086): Fair FIFO waitlist matchmaker with time-limited (15-minute) reservation hold offers.
  • Analytics Service (Port 8087): Real-time event aggregation and dining conversion KPI metrics.
  • Notification Service (Port 8088): Event-driven email delivery via Mailpit SMTP and automated 24-hour reservation reminder schedulers.
  • Container & Kubernetes Delivery: Built with Google Jib (jib-maven-plugin) for fast, daemonless, multi-arch container builds without Dockerfiles, with production Kubernetes manifests and Kustomize overlays in k8s/.
  • Remote JDWP Debugging: Pre-configured socket agents on ports 5080–5088 allowing direct IDE debugger attachment to any containerized service on localhost without restarts.

Key Architectural Patterns & Technologies

The platform serves as a reference implementation for modern Java 26, Spring Boot 4.1.1, and cloud-native enterprise patterns:

  • Virtual Threads (Project Loom): Enabled across all services via spring.threads.virtual.enabled=true, allowing high-throughput blocking JPA/JDBC queries to scale without thread-pool exhaustion.
  • Transactional Outbox Pattern: Eliminates dual-write anomalies by persisting business entities and domain events in a single local database transaction before asynchronous Kafka dispatch.
  • Idempotent Event Consumers: Consumers track processed event_id keys in dedicated tables to safely handle duplicate message deliveries with at-least-once semantics.
  • Deterministic Allocation Algorithm: Evaluates single tables first (selecting the smallest optimal fit) before evaluating physical table combination topologies.
  • Keycloak 26 OIDC & Fine-Grained RBAC: Enforces role boundaries across CUSTOMER, RESTAURANT_MANAGER, and ADMIN via JWT realm access roles, with profile-aware multi-issuer validation for seamless local and Docker network execution.
  • RFC 7807 / RFC 9457 Problem Details & Validation: Standardized, strongly-typed error responses (application/problem+json) with structured field-level invalidParams arrays for query parameters and JSON payloads.
  • Authoritative Cancellation Policy: Snapshots restaurant-configured cancellation deadlines onto bookings at creation time, preventing client bypass of cancellation windows.
  • Interactive OpenAPI & Swagger UI: Automated endpoint documentation exposed across every microservice via SpringDoc (springdoc-openapi-starter-webmvc-ui) with Bearer JWT authorize support.
  • End-to-End Observability Pipeline: Unified telemetry across all microservices using OpenTelemetry (OTEL), W3C distributed trace propagation, Micrometer Tracing, Prometheus, Grafana, and automated OpenSearch Dashboards.

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, Keycloak 26, and OpenTelemetry.