PUBACK
Fixed header flags: 0000 – all flags reserved
PUBACK is the acknowledgement for a QoS 1 PUBLISH packet. The receiver sends PUBACK after it has accepted responsibility for the message. In MQTT 5.0, PUBACK carries a reason code – 0x00 = Success, 0x10 = No matching subscribers (message accepted but no one is subscribed), 0x80+ = failure codes.
Details
PUBACK completes the QoS 1 delivery flow: PUBLISH → PUBACK.
The publisher considers delivery complete when PUBACK is received. Until then, the publisher must store the message and may retransmit with DUP=1 if no PUBACK is received within the retry timeout.
MQTT 5.0 reason codes in PUBACK: 0x00 = Success 0x10 = No Matching Subscribers (accepted, not delivered) 0x80 = Unspecified error 0x83 = Implementation specific error 0x87 = Not Authorized 0x90 = Topic Name Invalid 0x91 = Packet Identifier In Use 0x97 = Quota Exceeded 0x99 = Payload Format Invalid
The Packet Identifier in PUBACK must match the PUBLISH being acknowledged. Packet Identifiers are 2-byte unsigned integers (1–65535) assigned by the sender. They are scoped to the connection and reused after acknowledgement.
Fixed Header
| Field | Value |
|---|---|
| Packet type (bits 7–4) | 4 (0100₂) |
| First byte (hex) | 0x40 |
| Flags (bits 3–0) | 0000 – all flags reserved |
| QoS bits apply | No |
| Direction | both |
| Added in | MQTT 3.1 |