Protocol guide

MQTT QoS 0 vs 1 vs 2

Choose QoS by delivery contract, acknowledgements, and cost instead of treating it as a magic number.

QoS guide

Pick the delivery contract before picking the number.

QoS is a product and operations decision. Match it to retry cost, duplicate tolerance, and message value.

PUBLISH

At most once

Fire-and-forget delivery for high-frequency telemetry where the next reading matters more than a retry.

  • AcknowledgementsNone
  • Network costLowest
  • Best fitSensor streams

Use the QoS guide to choose MQTT delivery behavior by duplicate tolerance, retry cost, latency, and business value.

Decision model

QoS is an operations choice before it is a protocol number.

QoS 0, 1, and 2 trade latency, acknowledgements, retry behavior, and broker work. The right choice depends on how expensive message loss or duplication is for a specific topic.

  • QoS 0 for frequent telemetry that can be replaced by the next sample
  • QoS 1 for commands and alerts where duplicates are acceptable
  • QoS 2 for rare state changes where duplicates are costly
  • Mix QoS levels by topic instead of choosing one globally
Consumer behavior

Design consumers for the QoS level you choose.

QoS 1 can deliver duplicates, so consumers should be idempotent. QoS 2 reduces duplicates at the protocol layer but still requires durable application logic for real systems.

  • Use message IDs or state versioning
  • Make command handlers idempotent
  • Record processed events when side effects matter
  • Test disconnect and reconnect behavior
Cost

Higher QoS increases network and broker work.

Every acknowledgement has a cost. On mobile, satellite, battery-powered, or high-frequency telemetry networks, unnecessary QoS can reduce throughput and increase energy usage.

  • Measure latency with realistic networks
  • Do not use QoS 2 for every telemetry point
  • Document topic-level QoS expectations
  • Test retained and queued messages separately