The Connectivity service establishes and manages client-side connections to external message brokers, translating between Ditto Protocol messages and external transport protocols.
Overview
You use the Connectivity service to integrate Ditto with external systems. It creates client-side connections to message brokers and other endpoints, sends and receives Ditto Protocol messages over those connections, and maps custom payloads when needed.
If you cannot transform your payload to a Ditto Protocol Message on the client side, the Connectivity service provides flexible and customizable payload mapping.
How it works
Model
The service is built around the Connection entity:
Signals
Other services communicate with the Connectivity service through two signal types:
- ConnectivityCommands: Commands for managing connections (create, modify, open, close, delete)
- ConnectivityEvents: Events emitted when connection entities change
Persistence
The Connectivity service uses Pekko persistence with event sourcing to persist and restore connections.
Enforcement
The Connectivity service does not enforce authorization through policies because connections do not reference a policyId. Access control for connection management is handled through the DevOps user or via the HTTP API with appropriate permissions.
Tasks
The Connectivity service performs these core tasks:
- Create and remove connections by persisting their configuration
- Connect to and disconnect from external endpoints
- Restore existing connections on restart or failover
- Translate incoming Ditto Protocol messages to commands and translate command responses back to Ditto Protocol response messages
- Map custom message protocols to the Ditto Protocol via Protocol Bindings