Collection of libraries (modules), each solving a specific problem, helps to build, run, and manage microservice systems.
Spring Boot → already built few services (different project)
Spring Cloud → connect MANY services
user-serviceorder-servicepayment-service Client
↓
┌──────────────────┐
│ API Gateway │
└──────────────────┘
↓
┌──────────────┼──────────────┐
│ │ │
User Service Order Service Payment Service
│ │ │
└─────── registers with Eureka ┘
↑
Service Registry
↑
Config Server (Git)
# External traffic → Gateway only
# Internal traffic → Service ↔ Service (Eureka)
Each are different Spring Boot projects:
1. config-server (Spring Cloud Config)
2. service-registry (Eureka Server)
3. api-gateway (Spring Cloud Gateway)
Create another Spring Boot project, just for config files.
Git Repo (configs)
├── user-service.yml
├── order-service.yml
├── payment-service.yml
└── gateway.yml
Dependency: spring-cloud-starter-config
Main class enable config server
@SpringBootApplication
@EnableConfigServer
public class ConfigServerApplication {
public static void main(String[] args) {
SpringApplication.run(ConfigServerApplication.class, args);
}
}