Azure IoT Hub: What Happens When a Message Delivery Fails 10 Times?

When Message Delivery Fails 10 Times

Question

You want to send cloud to device messages to your field devices.

In order to minimize the risk of lost messages, you set the Max delivery count on the IoT Hub to 10

What happens to a message when its delivery fails 10 times?

Answers

Explanations

Click on the arrows to vote for the correct answer

A. B. C. D.

Correct Answer: C.

Option A is incorrect because the message is in Invisible state while it is available for the target device for retrieval.

Option B is incorrect because the message becomes Expired when its time to live (ttl) time passes.

Option C is CORRECT because the IoT Hub attempts to deliver the messages max delivery count times After that number of failures, the IoT hub sets the state of the message to Dead lettered.

Option D is incorrect because Enqueued is the state where the message is put when the IoT Hub tries to deliver it.

It means that the message is in a queue waiting to be retrieved by the target device.

Diagram:

@ miothub001 | Built-in endpoints ¥#

loT Hub

P Search (Ctrl+/)

© Built-in endpoints
-'+ Failover

= Properties
& Locks
Explorers

B query explorer

IB loT devices

Automatic Device Management

& lot Edge

© oT device configuration
© Device updates
Messaging

© File upload

Message routing

Security

save “D Undo

Event Hub compatible endpoint

Only policies that allow service connect permissions can be selected. These permissions are applied to the built-in endpoint.

Shared access policy ©

| iothubowner v |

Event Hub-compatible endpoint ©
[_Endpoint=sbi/iothub-ns-miothub001-8675036-d39 1ba2eec.servicebus.windows.net/;SharedAccessKeyName=iothubownerShared ... |

Cloud to device messaging

Control message retention time and retry attempts.

Default TTL ©

—_————_—__CoCOC—————____——

Feedback retention time ©

Hours

Maximum delivery count ©

Attempts
—_—O P

References:

When a cloud-to-device message is sent from an IoT hub to a field device, the IoT hub makes several attempts to deliver the message to the device. The number of delivery attempts that an IoT hub makes is determined by the value of the Max delivery count property, which is set to 10 in this case.

If the message cannot be delivered to the device after 10 delivery attempts, the IoT hub sets the status of the message to Dead-lettered. This means that the message has failed to be delivered and has been moved to a special queue called the dead-letter queue (DLQ).

The dead-letter queue is used to store messages that cannot be delivered to their intended destination. Dead-lettered messages can be retrieved from the dead-letter queue and examined to determine why they could not be delivered. This can help developers to identify and fix issues in their IoT solutions.

In summary, the answer is C. When the delivery of a message fails 10 times, its status is set to Dead-lettered, and it is moved to the dead-letter queue.