← Back to the chapter

Technical detail · Pub/Sub and Topic Routing

Why QoS cannot prove exactly-once action

QoS covers a delivery exchange between a client and broker. A bridge can still retry after that exchange, or a consumer can restart after a partial write. A broker’s duplicate suppression does not establish exactly-once command execution across the whole pipeline.

Give each source message a stable ID and have the consumer record which IDs it has processed. Include source identity and timestamp in the application record. Idempotency makes repeated delivery safe under the consumer’s processing rule. Coordinate the action and the processed-ID record so a crash cannot repeat the action. A message identifier alone cannot prove that coordination worked.

If a gateway acknowledges a command before a valve reports its final state, retain a device outcome receipt linked to the command ID. The broker receipt describes delivery at its boundary; the outcome receipt connects the request to what the device actually did. Retaining the request does not supply that outcome, and changing QoS does not disable retained delivery.

← Back to the chapter