SpecsModelExplore
Overview
Actors
External Systems
IoT Platform
Edge
Ingestion
MQTT Broker
TLS ListenerTopic RouterSession Store
Command Router
Stream Processing
Device Management
User-Facing Apps
Platform
Topic Router
Matching
Behaviour
SpecsModelExplore
Topic Router
OverviewGuideLinks and Communications

Topic Router

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.

Matching

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.

Behaviour

  • Authenticated connections arrive from the TLS Listener; the router never sees an unauthenticated client.
  • Matching is per-message and lock-light: the trie is updated on subscribe / unsubscribe and read on every publish.
  • Delivery hands off to the session layer, which applies the per-subscription QoS and queues messages for offline clients.