The API Gateway acts as a unified entry point for routing requests to the respective microservices.
- Proxy and routing for requests.
- Simplifies interaction with internal services.
- Java Spring Boot
- REST API
- Docker
- Kubernetes
POST /api/orders
: Forwards the request to the Order Service.GET /api/orders/{id}
: Forwards the request to the Order Service.GET /api/inventory/check/{productId}
: Forwards the request to the Inventory Service.PUT /api/inventory/reduce/{productId}
: Forwards the request to the Inventory Service.
-
Docker:
- Build the image:
docker build -t api-gateway-service .
- Run the container:
docker run -p 8080:8080 api-gateway-service
- Build the image:
-
Kubernetes:
- Apply deployment and service manifests:
kubectl apply -f deployment.yaml kubectl apply -f service.yaml
- Apply deployment and service manifests: