The Gateway service provides Ditto’s external-facing HTTP and WebSocket APIs, translating between HTTP/WebSocket requests and internal Ditto signals.
TL;DR: The Gateway service is the entry point for all HTTP and WebSocket traffic. It translates HTTP requests into internal commands, routes Ditto Protocol messages from WebSocket and Cloud Events, and streams change notifications back to connected clients.
Overview
The Gateway service acts as Ditto’s API layer. It does not own any entities or persistence – instead, it translates external requests into internal signals and forwards them to the appropriate services within the cluster.
How it works
Model and signals
The Gateway service does not define its own entity model or signal types. It uses the models and signals from all other Ditto services to provide a unified API surface.
Persistence
The Gateway service does not maintain any persistence of its own.
Tasks
The Gateway service performs these core tasks:
- HTTP API: Translate incoming HTTP requests to commands and translate command responses back to HTTP responses
- WebSocket API: Translate Ditto Protocol messages arriving via WebSocket to commands, and translate responses back to Ditto Protocol messages
- Cloud Events: Accept Ditto Protocol messages via the Cloud Events HTTP Binding
- Change notifications: Subscribe to events in the Ditto cluster and stream change notifications to connected WebSocket clients and SSE consumers