System Topics

The shiftr.io platform offers various system topics that allow clients to inspect the namespace and obtain valuable meta data.

Please note that system topics are not in their final state and may receive minor changes.

Events

A MQTT subscription to $events will put the client in a special mode where all interactions with the namespace are received as JSON encoded objects under the $events topic. A subscription to $events will temporarily shadow other subscriptions as all messages are received as events.

Connected

1
2
3
4
5
6
7
8
{
  "type": "connected",
  "connection": {
    "id": "5bda2ea6e334550009ab27f8",
    "name": "test",
    "read_only": false
  }
}

Subscribed

1
2
3
4
5
6
7
8
9
10
{
  "type": "subscribed",
  "subscription": {
    "id": "5bda2ea948dd09537cf07405",
    "topic": "foo",
    "qos": 1,
    "root_slash": false,
    "connection_id": "5bda2ea6e334550009ab27f8"
  }
}

Published

1
2
3
4
5
6
7
8
9
10
11
{
  "type": "published",
  "message": {
    "id": "5bda2eace334550009ab2f87",
    "topic": "foo",
    "payload": "Y29vbA==",
    "qos": 0,
    "retained": false,
    "connection_id": "5bda2ea6e334550009ab27f8"
  }
}

Unsubscribed

1
2
3
4
5
6
7
8
9
10
{
  "type": "unsubscribed",
  "subscription": {
    "id": "5bda2ea948dd09537cf07405",
    "topic": "foo",
    "qos": 1,
    "root_slash": false,
    "connection_id": "5bda2ea6e334550009ab27f8"
  }
}

Disconnected

1
2
3
4
5
6
7
8
{
  "type": "disconnected",
  "connection": {
    "id": "5bda2ea6e334550009ab27f8",
    "name": "test",
    "read_only": false
  }
}

Errored

1
2
3
4
5
6
7
8
{
  "type": "errored",
  "error": {
    "code": "invalid-topic",
    "topic": "foo/+",
    "connection_id": "5bda2eeee334550009ab85b0"
  }
}

Actions

A HTTP POST request or a MQTT publication to $action with a JSON encoded object will instruct the broker to perform various actions.

Close

1
2
3
4
{
  "type": "close",
  "connection": "5bda2cb9e334550009a88e57"
}

Info

A HTTP GET request or a MQTT subscription to $info will return a JSON encoded object that includes various information about the current state of the namespace.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
{
  "topics": [
    "foo",
    "bar/baz"
  ],
  "connections": [
    {
      "id": "5bda2cb9e334550009a88e57",
      "name": "test",
      "read_only": false
    }
  ],
  "subscriptions": [
    {
      "id": "5bda2de448dd09537cef9e34",
      "topic": "foo",
      "qos": 1,
      "root_slash": false,
      "connection_id": "5bda2cb9e334550009a88e57"
    }
  ]
}

Rate

A HTTP GET request or a MQTT subscription to $rate will return a JSON encoded object that includes information about the current rate limit:

1
2
3
4
5
6
7
8
{
  "scope": "user",
  "limit": 6000,
  "remaining": 5999,
  "period": 60,
  "retry_in": 0,
  "reset_in": 1
}