POC de exemplo que demonstra a integração de um API Gateway, um Service Registry (Eureka) e um serviço simples usando Spring Boot e Spring Cloud.
api-gateway-service-registry-simple-service-api
│
├── pom.xml
├── api-gateway
│ └── pom.xml
├── service-registry-api
│ └── pom.xml
└── simple-service-api
└── pom.xml
git clone /~https://github.com/pauloruszel/api-gateway-service-registry-simple-service-api.git
cd api-gateway-service-registry-simple-service-api
mvn clean install
- Service Registry (Eureka)
mvn -pl service-registry-api spring-boot:run
✨ Acesse o Eureka Dashboard em http://localhost:8761
- Simple Service API
mvn -pl simple-service-api spring-boot:run
- API Gateway
mvn -pl api-gateway spring-boot:run
✨ Acesse o serviço através do Gateway em http://localhost:8080/simple-service-api/hello
api-gateway-service-registry-simple-service-api
├── api-gateway
│ ├── src/main/java/com/br/api/gateway/ApiGatewayApplication.java
│ ├── src/main/resources/application.yml
│ └── pom.xml
├── service-registry-api
│ ├── src/main/java/com/br/service/registry/ServiceRegistryApplication.java
│ ├── src/main/resources/application.yml
│ └── pom.xml
└── simple-service-api
├── src/main/java/com/br/simple/service/SimpleServiceApplication.java
├── src/main/java/com/br/simple/service/HelloWorldController.java
├── src/main/resources/application.yml
└── pom.xml
Java 17
Spring Boot 3.3
Spring Cloud 2023.0.2
Maven 3.6.3