Control Messages
Where control messages travel
Section titled “Where control messages travel”- Drafts 07–16: one bidirectional control stream carries every control message. Draft-16 also sends each
SUBSCRIBE_NAMESPACEon its own bidirectional stream. - Drafts 17–23: each peer opens a control stream that starts with
SETUP. Every request (SUBSCRIBE,PUBLISH,FETCH,TRACK_STATUS,PUBLISH_NAMESPACE,SUBSCRIBE_NAMESPACE, and from draft-18SUBSCRIBE_TRACKS) opens its own bidirectional request stream, which carries the request, its response and any updates. Closing that stream ends the request, so there are no separate unsubscribe or cancel messages.
The tables below list the draft-23 messages, with the drafts each one exists in and the message that does the same job in earlier drafts. See the control message type reference for the type codes of every supported draft.
Session
Section titled “Session”| Message | Type ID | Sent by | Drafts | Earlier drafts |
|---|---|---|---|---|
| SETUP | 0x2F00 | Both | 17–23 | CLIENT_SETUP + SERVER_SETUP: 0x20 / 0x21 in 11–16, 0x40 / 0x41 in 07–10 |
| GOAWAY | 0x10 | Both | 07–23 |
Drafts 07–16 also have a request-ID credit message: MAX_SUBSCRIBE_ID (0x15) in 07–10, MAX_REQUEST_ID (0x15) in 11–16.
Responses and updates
Section titled “Responses and updates”| Message | Type ID | Sent by | Drafts | Earlier drafts |
|---|---|---|---|---|
| REQUEST_OK | 0x07 | Receiver of a request | 15–23 | A separate OK message per request type |
| REQUEST_ERROR | 0x05 | Receiver of a request | 15–23 | A separate ERROR message per request type, e.g. SUBSCRIBE_ERROR (0x05) |
| REQUEST_UPDATE | 0x02 | Sender of a request, or the subscriber of a PUBLISH | 16–23 | SUBSCRIBE_UPDATE (0x02) in 07–15 |
Subscription
Section titled “Subscription”| Message | Type ID | Sent by | Drafts | Earlier drafts |
|---|---|---|---|---|
| SUBSCRIBE | 0x03 | Subscriber | 07–23 | |
| SUBSCRIBE_OK | 0x04 | Publisher | 07–23 | |
| PUBLISH | 0x1D | Publisher | 12–23 | |
| PUBLISH_DONE | 0x0B | Publisher | 14–23 | SUBSCRIBE_DONE (0x0B) in 07–13 |
| PUBLISH_STATE_NOTIFY | 0x22 | Publisher | 20–23 |
PUBLISH is accepted with PUBLISH_OK (0x1E) in drafts 12–18 and with REQUEST_OK in drafts 19–23. UNSUBSCRIBE (0x0A) exists in drafts 07–16.
| Message | Type ID | Sent by | Drafts | Earlier drafts |
|---|---|---|---|---|
| FETCH | 0x16 | Subscriber | 07–23 |
In drafts 07–22 a successful FETCH is answered with FETCH_OK (0x18); in draft-23 it is answered with REQUEST_OK. FETCH_CANCEL (0x17) exists in drafts 07–16, and FETCH_ERROR (0x19) in drafts 07–14.
Namespaces
Section titled “Namespaces”| Message | Type ID | Sent by | Drafts | Earlier drafts |
|---|---|---|---|---|
| PUBLISH_NAMESPACE | 0x06 | Publisher | 14–23 | ANNOUNCE (0x06) in 07–13 |
| SUBSCRIBE_NAMESPACE | 0x50 | Subscriber | 18–23 | SUBSCRIBE_NAMESPACE (0x11) in 13–17, SUBSCRIBE_ANNOUNCES (0x11) in 07–12 |
| NAMESPACE | 0x08 | Publisher | 16–23 | |
| NAMESPACE_DONE | 0x0E | Publisher | 16–23 | |
| SUBSCRIBE_TRACKS | 0x51 | Subscriber | 18–23 | |
| PUBLISH_SKIPPED | 0x0F | Publisher | 19–23 | PUBLISH_BLOCKED (0x0F) in 17–18 |
How discovery works in each draft is on the SUBSCRIBE_NAMESPACE explainer.
Track status
Section titled “Track status”| Message | Type ID | Sent by | Drafts | Earlier drafts |
|---|---|---|---|---|
| TRACK_STATUS | 0x0D | Subscriber | 13–23 | TRACK_STATUS_REQUEST (0x0D) in 07–12 |
The name changes sides at draft-13. Through draft-12 the request is
TRACK_STATUS_REQUEST (0x0D) and TRACK_STATUS (0x0E) is the response;
from draft-13 TRACK_STATUS (0x0D) is the request, answered by
TRACK_STATUS_OK (0x0E) in drafts 13–14 and by REQUEST_OK from draft-15.
Code matching on the name alone across that boundary compares a response against
a request.
See draft-07’s own table for the oldest supported draft.