How dmslob/atlas-hotel works
1. System shape
This repository is a Spring-based microservice suite for a hotel domain. It is split into a control plane for configuration/discovery/routing and a business plane for guest, room, and reservation operations.
2. Control plane services
- config-server centralizes runtime configuration. Its src/main/resources/config/*.yaml files hold per-service config for guest, room, and reservation services.
- eurekaserver is the service registry used for discovery.
- gatewayserver is the edge entry point for client traffic and contains request tracing and fallback handling.
3. Request entry path
External clients are expected to hit the gateway first. The gateway applies request filtering/tracing, then routes to backend services using registry-based discovery. The presence of a FallbackController indicates it is also the failure boundary when downstream calls fail.
4. Business services
- guest-service manages guest data.
- room-service manages room data.
- reservation-service manages reservations and coordinates with the other two services.
Each service follows the same layered pattern: controller -> service -> repository -> entity, with DTOs/models for API contracts and a global exception handler for consistent error responses.
5. Reservation orchestration
reservation-service is the only service that clearly depends on other services at runtime. It uses Feign clients for guest-service and room-service, plus fallback classes for resilience. That makes reservation the orchestration point for combining guest and room information with reservation persistence.
6. Data ownership
Each domain service has its own schema.sql and data.sql, which strongly suggests service-local persistence rather than a shared database. The repositories are isolated per service, reinforcing bounded contexts:
- GuestRepository
- RoomRepository
- ReservationRepository
7. Configuration and runtime binding
Services are designed to bootstrap from the config server and register themselves in Eureka. The config server exposes service-specific YAML by application name, so runtime behavior is externalized from the codebase and can be refreshed without redeploying.
8. Resilience and failure behavior
The architecture includes explicit resilience points:
- Feign fallback implementations in reservation-service
- Gateway fallback controller
- Actuator-based refresh endpoints
- Readme references to Spring Cloud Bus refresh via RabbitMQ
This indicates the system is meant to tolerate partial downstream failures and support live config changes.
9. Observability stack
The docker-compose/observability folder includes Prometheus, Grafana, Loki, Tempo, and Alloy. That means the services expose metrics/logs/traces via Spring Boot Actuator, Prometheus scrapes metrics, and Grafana is the visualization layer. Observability is a first-class part of the runtime topology, not an afterthought.
10. Deployment model
The repo is organized for containerized local composition and image publishing. The README shows:
- Jib-based image builds per service
- Docker Hub image pushes
- docker-compose/default for bringing the stack up locally
So the main deployment unit is the individual microservice container, coordinated by compose in local environments.
11. API surface and developer access
The domain services expose Swagger UI endpoints for interactive API docs, which implies they are independently consumable APIs rather than internal-only components. The gateway and control-plane services are operational infrastructure rather than user-facing business APIs.
12. Optional external integration
The README mentions Keycloak for authN/authZ, but it is not represented as an in-repo service. Treat it as an external optional identity provider that can sit in front of the gateway or protected services.
Main entry points: GatewayServerApplication.java Gateway · GuestServiceApplication.java Guest Service · RoomServiceApplication.java Room Service · docker-compose.yml Compose Stack
Components 24
Control Plane
Discovery, config, and edge routing
- Config Server · Centralized runtime configuration service
config-server/src/main/java/com/dmslob/configserver/ConfigServerApplication.java - Service Config · Per-service configuration loaded by the config server
config-server/src/main/resources/config - Eureka Server · Discovery registry for backend services
eurekaserver/src/main/java/com/dmslob/eurekaserver/EurekaServerApplication.java - Gateway · Edge entry point for client traffic and downstream routing
gatewayserver/src/main/java/com/dmslob/gatewayserver/GatewayServerApplication.java - Trace Filter · Adds request tracing and filtering at the edge
gatewayserver/src/main/java/com/dmslob/gatewayserver/filters/RequestTraceFilter.java - Fallback API · Failure boundary returned when routed calls fail
gatewayserver/src/main/java/com/dmslob/gatewayserver/controller/FallbackController.java
Business Plane
Domain services for guests, rooms, and reservations
- Guest Service · Manages guest data and APIs
guest-service/src/main/java/com/dmslob/guestservice/GuestServiceApplication.java - Guest API · Guest HTTP entrypoint
guest-service/src/main/java/com/dmslob/guestservice/controller/GuestController.java - Guest Logic · Guest domain operations and validation
guest-service/src/main/java/com/dmslob/guestservice/service/GuestServiceImpl.java - Guest Repo · Guest data access boundary
guest-service/src/main/java/com/dmslob/guestservice/repository/GuestRepository.java - Room Service · Manages room data and APIs
room-service/src/main/java/com/dmslob/roomservice/RoomServiceApplication.java - Room API · Room HTTP entrypoint
room-service/src/main/java/com/dmslob/roomservice/controller/RoomController.java - Room Logic · Room domain operations and validation
room-service/src/main/java/com/dmslob/roomservice/service/RoomServiceImpl.java - Room Repo · Room data access boundary
room-service/src/main/java/com/dmslob/roomservice/repository/RoomRepository.java - Reservation Service · Coordinates reservations across guest and room domains
reservation-service/src/main/java/com/dmslob/reservationservice/ReservationServiceApplication.java - Reservation API · Reservation HTTP entrypoint
reservation-service/src/main/java/com/dmslob/reservationservice/controller/ReservationController.java - Reservation Logic · Combines local persistence with remote guest and room lookups
reservation-service/src/main/java/com/dmslob/reservationservice/service/ReservationServiceImpl.java - Feign Clients · Typed clients for guest-service and room-service
reservation-service/src/main/java/com/dmslob/reservationservice/service/client - Reservation Repo · Reservation data access boundary
reservation-service/src/main/java/com/dmslob/reservationservice/repository/ReservationRepository.java - Guest Fallback · Resilience path when guest lookup fails
reservation-service/src/main/java/com/dmslob/reservationservice/service/client/GuestFallback.java - Room Fallback · Resilience path when room lookup fails
reservation-service/src/main/java/com/dmslob/reservationservice/service/client/RoomFallback.java
Operations
Local composition and observability
- Compose Stack · Local container composition for the whole system
docker-compose/default/docker-compose.yml - Observability · Prometheus, Grafana, Loki, Tempo, and Alloy
docker-compose/observability/prometheus/prometheus.yml
External
Outside systems referenced by the repo
- Keycloak · Optional external identity provider referenced by the repository
Connections 38
- Config Server → Service Config: serves · Publishes service-specific runtime configuration
- Config Server → Guest Service: configures · Provides guest-service settings at bootstrap
- Config Server → Room Service: configures · Provides room-service settings at bootstrap
- Config Server → Reservation Service: configures · Provides reservation-service settings at bootstrap
- Eureka Server → Gateway: registers · Gateway discovers downstream services through the registry
- Eureka Server → Guest Service: registers · Guest service advertises itself for discovery
- Eureka Server → Room Service: registers · Room service advertises itself for discovery
- Eureka Server → Reservation Service: registers · Reservation service advertises itself for discovery
- Gateway → Trace Filter: applies · Edge filter chain adds request tracing
- Gateway → Fallback API: falls back · Handles downstream failures at the gateway boundary
- Gateway → Eureka Server: routes via · Resolves backend destinations through service discovery
- Gateway → Guest Service: routes to · Forwards guest traffic to the guest service
- Gateway → Room Service: routes to · Forwards room traffic to the room service
- Gateway → Reservation Service: routes to · Forwards reservation traffic to the reservation service
- Guest Service → Guest API: exposes · HTTP API surface for guest operations
- Guest API → Guest Logic: delegates · Controller delegates business logic to the service layer
- Guest Logic → Guest Repo: persists via · Guest logic stores and reads guest records
- Room Service → Room API: exposes · HTTP API surface for room operations
- Room API → Room Logic: delegates · Controller delegates business logic to the service layer
- Room Logic → Room Repo: persists via · Room logic stores and reads room records
- Reservation Service → Reservation API: exposes · HTTP API surface for reservation operations
- Reservation API → Reservation Logic: delegates · Controller delegates orchestration to the service layer
- Reservation Logic → Reservation Repo: persists via · Reservation state is stored locally
- Reservation Logic → Feign Clients: calls · Uses remote clients for guest and room lookups
- Feign Clients → Guest Service: fetches guest · Remote guest lookup through service discovery
- Feign Clients → Room Service: fetches room · Remote room lookup through service discovery
- Feign Clients → Guest Fallback: fallback · Guest client has a resilience fallback
- Feign Clients → Room Fallback: fallback · Room client has a resilience fallback
- Compose Stack → Config Server: starts · Compose brings up the configuration service
- Compose Stack → Eureka Server: starts · Compose brings up the registry
- Compose Stack → Gateway: starts · Compose brings up the edge gateway
- Compose Stack → Guest Service: starts · Compose brings up guest-service
- Compose Stack → Room Service: starts · Compose brings up room-service
- Compose Stack → Reservation Service: starts · Compose brings up reservation-service
- Observability → Guest Service: scrapes · Observability stack collects service telemetry
- Observability → Room Service: scrapes · Observability stack collects service telemetry
- Observability → Reservation Service: scrapes · Observability stack collects service telemetry
- Keycloak → Gateway: secures · Optional external identity provider in front of the gateway