Documentation Index
Fetch the complete documentation index at: https://mintlify.com/Miguel-Rodriguez15/msvc/llms.txt
Use this file to discover all available pages before exploring further.
msvc-gateway is a Spring Cloud Gateway MVC service running on port 8090 that acts as the single entry point for the platform. It inspects the URL path prefix and forwards requests to the appropriate backend microservice — msvc-usuarios or msvc-cursos — using Kubernetes-native client-side load balancing. No business logic lives in the gateway itself.
msvc-gateway at a glance
| Property | Value |
|---|---|
| Port | 8090 |
| Database | None |
| Docker image | miguelrodriguez15/msvc-gateway:latest |
| Routing | Path-based, StripPrefix=2 |
| Discovery | Spring Cloud Kubernetes (lb://) |
Routing Configuration
All routes are defined inapplication.yaml. The gateway uses the MVC variant of Spring Cloud Gateway (spring-cloud-starter-gateway-server-webmvc), which runs on the standard Servlet stack rather than the reactive Netty stack.
StripPrefix=2 works: the filter removes the first two path segments before forwarding the request to the backend. For example:
| Incoming request | Forwarded to backend as |
|---|---|
GET /api/usuarios/ | GET / |
GET /api/usuarios/42 | GET /42 |
GET /api/cursos/ | GET / |
POST /api/cursos/asignar-usuario/1 | POST /asignar-usuario/1 |
msvc-usuarios and msvc-cursos API paths are accessible through the gateway without any changes to the backing services.
Route Table
| Route ID | Incoming Path Predicate | Backend URI | Effective Backend Path |
|---|---|---|---|
msvc-usuarios | /api/usuarios/** | lb://msvc-usuarios | /** |
msvc-cursos | /api/cursos/** | lb://msvc-cursos | /** |
Load Balancing
Thelb:// URI scheme instructs Spring Cloud Gateway to resolve the service name through Spring Cloud Kubernetes client-side load balancing (spring-cloud-starter-kubernetes-client-all). At runtime, lb://msvc-usuarios resolves to the IP addresses of all healthy msvc-usuarios pods in the cluster, and requests are distributed across them automatically. No Eureka or Consul registry is required — Kubernetes Services are used directly.
Spring Cloud Kubernetes discovery is enabled by the
spring-cloud-starter-kubernetes-client-all dependency in pom.xml. The gateway requires appropriate RBAC permissions (a ClusterRole or namespaced Role) to read Service and Endpoints resources from the Kubernetes API.The gateway does not currently validate JWT tokens. Authentication and authorisation are enforced at the individual service level —
msvc-usuarios validates bearer tokens as an OAuth2 Resource Server. Requests that reach a backend without a valid token will be rejected by the service, not by the gateway.Dockerfile
The image uses a two-stage build with a parameterisedMSVC_NAME build argument. The runtime port is set from the PORT_APP build argument (default 8090) and exposed via the PORT environment variable.