How eiselems/spring-boot-microservices works
Project Type & Purpose
• This is a Spring Boot microservices reference app (used in a tutorial series “Microservices with Mo”).
• It demonstrates a classic microservices landscape: configuration server, service registry, API gateway, and domain services (counterservice, template-service, etc.) running in Docker containers orchestrated by docker-compose.
File Structure
• Top-level microservice modules:
• configservice (Spring Cloud Config Server)
• registryservice (Eureka service discovery)
• gatewayservice (Netflix Zuul API Gateway)
• counterservice (business logic microservice)
• template-service (scaffolded, deployable service)
• Root files:
• docker-compose.yml + runDockerized.sh (orchestrate containers & networks)
• pom.xml (parent aggregator)
• tools/architecture.dot (graphviz source of the architecture)
• Each module has its own Dockerfile and Spring Boot entrypoint.
Extract Key Insights from README
• Execution: mvn clean package -DskipTests && docker-compose up --build.
• After startup: gateway listens on port 9999; counterservice on port 8080; all services register with Eureka and fetch config from configservice.
Main Components & Their Responsibilities
a. Components:
• Client (Browser/REST client)
• GatewayService (Zuul)
• RegistryService (Eureka Server)
• ConfigService (Spring Cloud Config Server)
• CounterService (stateless microservice)
• Template-Service (placeholder microservice)
• (Optional/Extensible) AdminService (Spring Boot Admin)
• Docker-Compose Network (virtual LAN)
b. Relationships & Interactions:
• On startup each service → registers with RegistryService.
• On startup each service → fetches its configuration from ConfigService (using bootstrap.properties).
• Client → HTTP request → GatewayService (port 9999) → looks up CounterService URI in RegistryService → routes request.
• CounterService increments counter, returns JSON.
• Services communicate over internal Docker network (defined in docker-compose.yml).
c. Architectural Patterns & Principles:
• Microservices – independent deployable units, one Spring Boot project per service.
• Service Discovery – Eureka (RegistryService) for dynamic lookup.
• API Gateway – Zuul (GatewayService) to route and handle cross-cutting concerns (e.g., security via SecurityConfig.java).
• Externalized Configuration – Spring Cloud Config (ConfigService) serving properties.
• Containerization – Dockerfile per service, orchestrated by docker-compose.
• Scalability – each service can be scaled horizontally via multiple container instances.
d. Key Technologies & Frameworks:
• Spring Boot & Spring Web (REST controllers)
• Spring Cloud Config Server
• Netflix Eureka Server
• Netflix Zuul Proxy
• Docker & Docker-Compose
• Maven
Elements to Include in Your Canvas
• Clear, human-readable labels on every component (e.g., “configservice: Spring Cloud Config”, “registryservice: Eureka”).
• Infrastructure (registry, config server)
• API layer (gateway)
• Business services
• External actor (client)