PUBCOMP
Fixed header flags: 0000 – all flags reserved
PUBCOMP is the final packet in the QoS 2 handshake. Sent by the broker to the publisher after PUBREL is received and the message has been delivered. Both sides release the packet identifier after PUBCOMP. The QoS 2 flow is complete.
Details
PUBCOMP completes the QoS 2 exactly-once flow: PUBLISH → PUBREC → PUBREL → PUBCOMP ✓
On receiving PUBCOMP, the publisher: 1. Discards the stored PUBLISH and PUBREL 2. Marks the packet identifier as available for reuse
MQTT 5.0 reason codes: 0x00 = Success, 0x92 = Packet Identifier Not Found.
QoS 2 overhead: four packets per message, each requiring a round trip. Only use QoS 2 when exactly-once delivery is genuinely required (financial transactions, command execution). For most IoT telemetry, QoS 0 or 1 is appropriate.
Fixed Header
| Field | Value |
|---|---|
| Packet type (bits 7–4) | 7 (0111₂) |
| First byte (hex) | 0x70 |
| Flags (bits 3–0) | 0000 – all flags reserved |
| QoS bits apply | No |
| Direction | both |
| Added in | MQTT 3.1 |