| ID | product.ingestion.mqtt_broker.topic_router |
|---|---|
| Description | Routes published messages to subscribers. |
| Key | topic_router |
| Type | component |
| Team | Ingestion |
| Owner | ingestion@iotgateway.example |
| Status | active |
| Technologies | Go, MQTT |
| Attributes | match: trie, throughput: 1M msgs/s |
| Tags |
The Topic Router is the heart of the broker’s pub/sub. Every published message is matched against the set of active subscriptions and delivered to the clients whose topic filters match — in both directions, telemetry going up and commands coming down.
Topic shape
Telemetry flows on devices/{deviceId}/telemetry/# and commands flow on
devices/{deviceId}/commands. Keeping device id high in the hierarchy lets
the router prune whole branches of the match trie quickly.
Subscriptions are kept in a topic trie so that a single publish can be matched against millions of filters without scanning them linearly. Wildcards are handled at the node level:
devices/+/telemetry matches one segment — every device’s telemetry root, but
not nested sub-topics.
1 incoming link · 1 outgoing link
| Source object | Label | Link type | Relation | Raw id | Required | Description | |
|---|---|---|---|---|---|---|---|
| persists sessions for | — | links | product.ingestion.mqtt_broker.topic_router | — | — |
| Target object | Label | Link type | Relation | Raw id | Required | Description | |
|---|---|---|---|---|---|---|---|
| routes traffic from | — | links | product.ingestion.mqtt_broker.tls_listener | — | — |