An open API service indexing awesome lists of open source software.

https://github.com/pauloruszel/api-gateway-service-registry-simple-service-api

POC para conectar um api simples em uma api-gateway e se registrarem num service-registry
https://github.com/pauloruszel/api-gateway-service-registry-simple-service-api

api-gateway eureka-client eureka-server java17-spring-boot rest-api service-registry spring-cloud-gateway spring-cloud-netflix

Last synced: 3 months ago
JSON representation

POC para conectar um api simples em uma api-gateway e se registrarem num service-registry

Awesome Lists containing this project

README

          

# πŸš€ API Gateway, Service Registry e Simple Service API

![Java](https://img.shields.io/badge/Java-17-blue.svg)
![Spring Boot](https://img.shields.io/badge/Spring%20Boot-3.3.0-brightgreen.svg)
![Maven](https://img.shields.io/badge/Maven-3.6.3-yellow.svg)

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.

## Estrutura do Projeto

api-gateway-service-registry-simple-service-api

```bash
β”‚
β”œβ”€β”€ pom.xml
β”œβ”€β”€ api-gateway
β”‚ └── pom.xml
β”œβ”€β”€ service-registry-api
β”‚ └── pom.xml
└── simple-service-api
└── pom.xml
```

## PrΓ©-requisitos

- [Java 17](https://adoptopenjdk.net/)
- [Maven 3.6.3+](https://maven.apache.org/)
- [IntelliJ IDEA](https://www.jetbrains.com/idea/)

### Clonando o RepositΓ³rio:

```bash
git clone https://github.com/pauloruszel/api-gateway-service-registry-simple-service-api.git
```

## πŸ› οΈ Construindo o Projeto

```bash
cd api-gateway-service-registry-simple-service-api
mvn clean install
```

1. Service Registry (Eureka)

```bash
mvn -pl service-registry-api spring-boot:run
```

✨ Acesse o Eureka Dashboard em http://localhost:8761

2. Simple Service API
```bash
mvn -pl simple-service-api spring-boot:run
```

3. API Gateway
```bash
mvn -pl api-gateway spring-boot:run
```

✨ Acesse o serviço através do Gateway em http://localhost:8080/simple-service-api/hello

## πŸ“ Estrutura de Pastas

```bash
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
```

## βœ”οΈ Tecnologias e bibliotecas usadas
- `Java 17`
- `Spring Boot 3.3`
- `Spring Cloud 2023.0.2`
- `Maven 3.6.3`