FireDevOps FireMUD & Ops Projects

🔀 Gateway Architecture

This document describes the role and configuration of Spring Cloud Gateway in the FireMUD platform, including routing, filtering, WebSocket support, and how it integrates with both modern and legacy clients.


🚪 Gateway Pattern

Spring Cloud Gateway serves as the single entry point into the FireMUD system for all external client traffic:

Important: Spring Cloud Gateway is responsible for routing only external client requests. Internal microservice-to-microservice communication does not pass through the Gateway. Microservices use Kubernetes native service discovery and DNS for direct communication. Services communicate with each other over gRPC. See System Architecture Overview and Authentication & Authorization for the complete login and gRPC flow.


🔷 WebSocket Support

Example WebSocket route config:

spring:
  cloud:
    gateway:
      routes:
        - id: game-session
          uri: ws://game-session-service:8080
          predicates:
            - Path=/ws/game/**

🔌 Telnet / TCP Bridging

This pattern ensures all real-time gameplay is unified through WebSocket on the backend, regardless of client type.


🔐 Centralized Gateway Benefits

Spring Cloud Gateway provides centralized management of client traffic, offering:

🔗 Internal gRPC Communication

Internal services communicate directly with each other over gRPC. Spring Cloud Gateway does not handle these calls. Each service discovers its peers via Docker or Kubernetes DNS and connects using the service name. This approach minimizes latency and matches the protocol table in the System Architecture Overview.


🔧 Dev vs. Prod Configuration

EnvironmentRoute Target FormatDiscovery Mechanism
Devhttp://service:8080Docker Compose DNS
Prodhttp://service.namespace.svc.cluster.local:8080Kubernetes DNS

Spring profiles (application-dev.yml, application-prod.yml) are used to configure routing targets based on environment.