Skip to main content
9

SUBACK

0x90Server to Client

Fixed header flags: 0000 – all flags reserved

SUBACK is the broker's response to SUBSCRIBE. It contains one reason code per topic filter in the SUBSCRIBE packet, in the same order. Reason code 0x00/0x01/0x02 indicates the maximum QoS granted. 0x80+ indicates failure. A client should not assume successful subscription until SUBACK confirms each filter.

Details

SUBACK reason codes (MQTT 5.0) per filter: 0x00 = Granted QoS 0 0x01 = Granted QoS 1 0x02 = Granted QoS 2 0x80 = Unspecified error 0x83 = Implementation specific error 0x87 = Not Authorized 0x8F = Topic Filter Invalid 0x91 = Packet Identifier In Use 0x97 = Quota Exceeded 0x9E = Shared Subscriptions Not Supported 0xA1 = Subscription Identifiers Not Supported 0xA2 = Wildcard Subscriptions Not Supported

The granted QoS may be lower than the requested QoS. The broker can downgrade but not upgrade. A granted QoS 0 on a QoS 2 request means messages will be delivered at most once regardless of publisher QoS.

Fixed Header

FieldValue
Packet type (bits 7–4)9 (1001₂)
First byte (hex)0x90
Flags (bits 3–0)0000 – all flags reserved
QoS bits applyNo
Directionserver-to-client
Added inMQTT 3.1

See Also