PUBREL
Fixed header flags: 0010 – bit 1 must be 1 (spec §3.6.1)
PUBREL is the publisher's release command in the QoS 2 handshake. Sent after receiving PUBREC. When the broker receives PUBREL, it delivers the message to subscribers and responds with PUBCOMP. PUBREL fixed header flags are 0010 – bit 1 must always be set to 1 per the MQTT 5.0 spec §3.6.1.
Details
PUBREL is step 3 of the QoS 2 flow. Its fixed header byte is always 0x62 (0110 0010), not 0x60 – the flags field 0010 is mandatory.
On receiving PUBREL, the broker: 1. Delivers the stored message to all matching subscribers 2. Discards the stored message 3. Sends PUBCOMP back to the publisher
The PUBREL packet identifier must match the original PUBLISH. Until PUBCOMP is received, the publisher must store the PUBREL and retransmit if the connection drops.
MQTT 5.0 reason codes in PUBREL: 0x00 = Success, 0x92 = Packet Identifier Not Found (the broker has no record of this packet ID – may happen after reconnect with state mismatch).
Fixed Header
| Field | Value |
|---|---|
| Packet type (bits 7–4) | 6 (0110₂) |
| First byte (hex) | 0x62 |
| Flags (bits 3–0) | 0010 – bit 1 must be 1 (spec §3.6.1) |
| QoS bits apply | No |
| Direction | both |
| Added in | MQTT 3.1 |