A simple microservices architecture using Spring Boot, Spring Cloud, and Spring Data JPA.
Includes:
- Config Server
- Eureka Server
- Company Service
- Proxy/Gateway Service
- Port: 8888
- Provides centralized configuration for all services.
- Example URL:
http://localhost:8888/company-service/default
- Port: 8761
- Service registry for discovery.
- Dashboard:
http://localhost:8761
- Port: 8082
- JPA repository exposed via Spring Data REST.
- Example endpoint:
GET http://localhost:8082/companies- Port: 8080
- Routes requests to backend services via Spring Cloud Gateway.
- Example endpoint through the gateway (proxying to company service):
GET http://localhost:8080/company-service/companiesStart each service from the project root using Maven. Example commands:
# Start Config Service
mvn spring-boot:run -pl config-service
# Start Eureka Server (service registry)
mvn spring-boot:run -pl register-service
# Start Company Service
mvn spring-boot:run -pl company-service
# Start Proxy / Gateway Service
mvn spring-boot:run -pl proxy-serviceNotes
- Make sure ports 8888, 8761, 8082 and 8080 are available.
- Start the Config Service before other services if they rely on centralized configuration.
- Start the Eureka Server before services that register with it (or run both in parallel if using a locally cached config during development).
Troubleshooting
- If a service fails to start, check its application logs for port conflicts or missing configuration.
- For Spring Cloud Gateway routing issues, verify service IDs and routes in the gateway configuration.
Enjoy building with Spring Boot microservices!