← Back to the chapter · Previous detail · Next detail →

Technical detail · MQTT Packet and Broker Features

MQTT 5 alias byte costs, worker selection and response matching

MQTT 5 topic aliases replace repeated routing names with short values, shared subscriptions divide messages among a worker group, and request/response properties match application replies to requests.

A topic is the routing name carried by a publication; the broker routes it to subscribers. An alias is established by sending both the name and its alias value. A shared subscription sends each matching publication to one group member.

Count alias savings only after establishment. With a 30-byte name, a later publish retains the two-byte topic-length field but sends an empty name and a three-byte Topic Alias property. Compared with a plain publication, the saving is 27 bytes. With a 42-byte topic, the later saving is 39 bytes because the three-byte alias property travels instead of the name. Establishing the alias costs extra bytes once, so account for that first message too.

Worker selection is broker-specific. Shared subscriptions do not promise round robin. Compare how the deployed broker handles a slow worker and its backlog rather than assuming a selection policy.

In the MQTT 5 request/response pattern, correlation data is an application-supplied value for matching a reply to its request. A request carries a response topic and correlation data; the responder uses them to direct and identify its reply. That lets an application associate a response with a request. Keep this application exchange distinct from MQTT’s protocol acknowledgements.

← Back to the chapter · Previous detail · Next detail →