Bird
0
0

What will happen if a client publishes a message with QoS 2 but the network disconnects before the handshake completes?

medium📝 Predict Output Q5 of 15
Raspberry Pi - MQTT for IoT
What will happen if a client publishes a message with QoS 2 but the network disconnects before the handshake completes?
AThe client will retry the handshake to ensure exactly once delivery.
BThe message is delivered at most once.
CThe message is lost and not delivered.
DThe broker will discard the message immediately.
Step-by-Step Solution
Solution:
  1. Step 1: Recall QoS 2 handshake process

    QoS 2 uses a four-step handshake to guarantee exactly once delivery, including retries if interrupted.
  2. Step 2: Understand network disconnect impact

    If network disconnects mid-handshake, client retries on reconnect to complete delivery.
  3. Final Answer:

    The client will retry the handshake to ensure exactly once delivery. -> Option A
  4. Quick Check:

    QoS 2 retries handshake until success [OK]
Quick Trick: QoS 2 retries handshake after disconnect to ensure delivery [OK]
Common Mistakes:
MISTAKES
  • Assuming message is lost on disconnect
  • Confusing QoS 2 with QoS 0 behavior

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Raspberry Pi Quizzes