How acenelio/ms-course works
Project type and purpose
• This is a Java/Spring Boot microservices ecosystem built for a course on Spring Cloud & Spring Boot.
• It implements common microservice patterns: service registry (Eureka), centralized configuration (Config Server), API gateway (Zuul), load-balancing (Ribbon), client-side load-balancing/fault tolerance (Feign/Hystrix), OAuth2 authentication, and several domain services (Worker, Payroll, User).
File structure
• Top-level modules (each a Maven sub-project):
• hr-config-server
• hr-eureka-server
• hr-api-gateway-zuul
• hr-worker
• hr-payroll
• hr-user
• hr-oauth
• Each service has the typical Spring Boot layout: src/main/java (application class, config, resources, controllers, entities, repositories/Feign clients, services).
• Configuration files:
• bootstrap.properties (for Config Server clients)
• application.properties (service settings, ports, DB, Eureka)
• Build scripts: pom.xml in each module, Maven wrapper.
• Postman environment and collection JSON at the root for manual testing.
README insights
• The course phases map directly to the modules:
• Phase 1: simple communication between hr-worker and hr-payroll (Feign, Ribbon)
• Phase 2: Eureka service registry, Hystrix, Zuul gateway
• Phase 3: Config Server for externalized, centralized configuration
• Phase 4: Authentication & authorization with hr-user and hr-oauth (JWT), gateway security.
a. Main components
• Clients (Postman, Browser, Mobile App)
• API Gateway (hr-api-gateway-zuul)
• Authentication Service (hr-oauth)
• User Service (hr-user)
• Worker Service (hr-worker)
• Payroll Service (hr-payroll)
• Service Registry (hr-eureka-server)
• Config Server (hr-config-server)
• Databases (H2 in-memory per service)
b. Relationships & interactions
• At startup, each microservice calls Config Server to fetch its config, then registers with Eureka.
• Clients call the API Gateway.
• Gateway routes requests to downstream services via Eureka discovery.
• Payroll Service calls Worker Service via Feign+Ribbon (through Eureka).
• Gateway secures routes: first authenticates via OAuth2 (hr-oauth), then passes JWT to downstream.
• Hystrix wraps calls (circuit breaker) on RPC paths.
c. Architectural patterns & principles
• Microservices architecture: each service is independent, with its own data store.
• Service Registry & Discovery (Eureka).
• Centralized Configuration (Config Server).
• API Gateway (Zuul) for routing, security, load-balancing at the edge.
• Client-side load-balancing (Ribbon) & declarative HTTP clients (Feign).
• Fault tolerance (Hystrix circuit breaker).
• OAuth2 authorization server issuing JWT tokens.
d. Technologies & frameworks
• Spring Boot 2.3.4, Java 11
• Spring Cloud Netflix: Eureka, Zuul, Ribbon, Feign, Hystrix
• Spring Cloud Config
• Spring Security OAuth2
• H2 in-memory DB