The Connections specification defines the Ditto Protocol topic structure and announcements for managed connections.
TL;DR: Connection announcements use the topic pattern
_/connectionId/connections/announcements/subject. Ditto publishes opened and closed announcements when a connection’s state changes.Topic structure for Connections
A valid topic consists of these elements:
_/<connectionId>/connections/announcements/<subject>
_: empty namespace placeholder (connections have no namespace).connectionId: the ID of the connection.group: alwaysconnections.criterion:announcements.subject: the announcement name.
Note: The topic path of the connections group does not contain a namespace since there is
no correlation between namespaces and connections. Also there is no channel unlike the things group.
Announcements
A connection announcement contains the announcement name as the last segment of the topic:
_/<connectionId>/connections/announcements/<announcement-name>
The Ditto Protocol representation:
ConnectionOpenedAnnouncement
Ditto publishes this announcement when a connection is being opened.
| Field | Value |
|---|---|
| topic | _/<connectionId>/connections/announcements/opened |
| path | / |
| value | JSON object with openedAt (ISO-8601 timestamp). |
Example: Connection opened announcement
ConnectionClosedAnnouncement
Ditto publishes this announcement when a connection is being closed gracefully.
| Field | Value |
|---|---|
| topic | _/<connectionId>/connections/announcements/closed |
| path | / |
| value | JSON object with closedAt (ISO-8601 timestamp). |
Example: Connection closed announcement
Further reading
- Connections – connection concepts and configuration
- Protocol specification – the full message format reference