You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/iot-hub/iot-hub-devguide-messages-c2d.md
+16-16Lines changed: 16 additions & 16 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -26,7 +26,7 @@ Each device queue holds, at most, 50 cloud-to-device messages. An error occurs i
26
26
27
27
## The cloud-to-device message life cycle
28
28
29
-
To guarantee at-least-once message delivery, your IoT hub persists cloud-to-device messages in per-device queues. For the IoT hub to remove the messages from the queue, the devices must explicitly acknowledge *completion*. This approach guarantees resiliency against connectivity and device failures.
29
+
To guarantee at-least-once message delivery, your IoT hub persists cloud-to-device messages in per-device queues. Devices must explicitly acknowledge *completion* of a message before the IoT hub removes the message from the queue. This approach guarantees resiliency against connectivity and device failures.
30
30
31
31
The life-cycle state graph is displayed in the following diagram:
32
32
@@ -46,20 +46,20 @@ The **max delivery count** property on the IoT hub determines the maximum number
46
46
47
47
The [How to send cloud-to-device messages with IoT Hub](iot-hub-csharp-csharp-c2d.md) article shows you how to send cloud-to-device messages from the cloud and receive them on a device.
48
48
49
-
A device ordinarily completes a cloud-to-device message when the loss of the message doesn't affect the application logic. An example of this might be when the device has persisted the message content locally or has successfully executed an operation. The message could also carry transient information, whose loss wouldn't impact the functionality of the application. Sometimes, for long-running tasks, you can:
49
+
A device ordinarily completes a cloud-to-device message when the loss of the message doesn't affect the application logic. An example of this completion might be when the device has persisted the message content locally or has successfully executed an operation. The message could also carry transient information, whose loss wouldn't impact the functionality of the application. Sometimes, for long-running tasks, you can:
50
50
51
51
* Complete the cloud-to-device message after the device has persisted the task description in local storage.
52
52
53
53
* Notify the solution back end with one or more device-to-cloud messages at various stages of progress of the task.
54
54
55
55
## Message expiration (time to live)
56
56
57
-
Every cloud-to-device message has an expiration time. This time is set by either of the following:
57
+
Every cloud-to-device message has an expiration time. This time is set by either of the following options:
58
58
59
59
* The **ExpiryTimeUtc** property in the service
60
60
* The IoT hub, by using the default *time to live* that's specified as an IoT hub property
61
61
62
-
For more information, see [Cloud-to-device configuration options](#cloud-to-device-configuration-options).
62
+
For more information about message expiration, see [Cloud-to-device configuration options](#cloud-to-device-configuration-options).
63
63
64
64
A common way to take advantage of a message expiration and to avoid sending messages to disconnected devices is to set short *time to live* values. This approach achieves the same result as maintaining the device connection state, but it is more efficient. When you request message acknowledgments, the IoT hub notifies you which devices are:
65
65
@@ -68,7 +68,7 @@ A common way to take advantage of a message expiration and to avoid sending mess
68
68
69
69
## Message feedback
70
70
71
-
When you send a cloud-to-device message, the service can request the delivery of per-message feedback about the final state of that message. You do this by setting the **iothub-ack** application property in the cloud-to-device message that's being sent to one of the following four values:
71
+
When you send a cloud-to-device message, the service can request the delivery of per-message feedback about the final state of that message. You can configure message feedback by setting the **iothub-ack** application property in the cloud-to-device message that's being sent to one of the following four values:
72
72
73
73
| Ack property value | Behavior |
74
74
| ------------ | -------- |
@@ -83,7 +83,7 @@ As explained in [Endpoints](iot-hub-devguide-endpoints.md), the IoT hub delivers
83
83
84
84
| Property | Description |
85
85
| ------------ | ----------- |
86
-
| EnqueuedTime | A timestamp that indicates when the feedback message was received by the hub |
86
+
| EnqueuedTime | A timestamp that indicates when the feedback message was received by the hub.|
@@ -93,14 +93,14 @@ The body is a JSON-serialized array of records, each with the following properti
93
93
94
94
| Property | Description |
95
95
| ------------------ | ----------- |
96
-
| enqueuedTimeUtc | A timestamp that indicates when the outcome of the message happened (for example, the hub received the feedback message or the original message expired)|
97
-
| originalMessageId | The *MessageId* of the cloud-to-device message to which this feedback information relates |
96
+
| enqueuedTimeUtc | A timestamp that indicates when the outcome of the message happened. For example, a timestamp that indicates when the hub received the feedback message or the original message expired.|
97
+
| originalMessageId | The *MessageId* of the cloud-to-device message to which this feedback information relates.|
98
98
| statusCode | A required string, used in feedback messages that are generated by the IoT hub: <br/> *Success* <br/> *Expired* <br/> *DeliveryCountExceeded* <br/> *Rejected* <br/> *Purged*|
99
-
| description | String values for *StatusCode*|
100
-
| deviceId | The *DeviceId* of the target device of the cloud-to-device message to which this piece of feedback relates |
101
-
| deviceGenerationId | The *DeviceGenerationId* of the target device of the cloud-to-device message to which this piece of feedback relates |
99
+
| description | String values for *StatusCode*.|
100
+
| deviceId | The *DeviceId* of the target device of the cloud-to-device message to which this piece of feedback relates.|
101
+
| deviceGenerationId | The *DeviceGenerationId* of the target device of the cloud-to-device message to which this piece of feedback relates.|
102
102
103
-
For the cloud-to-device message to correlate its feedback with the original message, the service must specify a *MessageId*.
103
+
The service must specify a *MessageId* so that the cloud-to-device message can correlate its feedback with the original message.
104
104
105
105
The body of a feedback message is shown in the following code example:
106
106
@@ -123,7 +123,7 @@ The body of a feedback message is shown in the following code example:
123
123
124
124
**Pending feedback for deleted devices**
125
125
126
-
When a device is deleted, any pending feedback is deleted as well. Device feedback is sent in batches. If a device is deleted in the narrow window (often less than 1 second) between when the device confirms receipt of the message and when the next feedback batch is prepared, the feedback will not occur.
126
+
When a device is deleted, any pending feedback is deleted as well. Device feedback is sent in batches. A narrow window, often less than one second, can occur between when a device confirms receipt of the message and when the next feedback batch is prepared. If a device is deleted in that narrow window, the feedback doesn't occur.
127
127
128
128
You can address this behavior by waiting a period of time for pending feedback to arrive before deleting your device. Related message feedback should be assumed lost once a device is deleted.
129
129
@@ -133,11 +133,11 @@ Each IoT hub exposes the following configuration options for cloud-to-device mes
| defaultTtlAsIso8601 | Default TTL for cloud-to-device messages | ISO_8601 interval up to 2 days (minimum 1 minute); default: 1 hour |
136
+
| defaultTtlAsIso8601 | Default TTL for cloud-to-device messages | ISO_8601 interval up to two days (minimum one minute); default: one hour |
137
137
| maxDeliveryCount | Maximum delivery count for cloud-to-device per-device queues | 1 to 100; default: 10 |
138
-
| feedback.ttlAsIso8601 | Retention for service-bound feedback messages | ISO_8601 interval up to 2 days (minimum 1 minute); default: 1 hour |
138
+
| feedback.ttlAsIso8601 | Retention for service-bound feedback messages | ISO_8601 interval up to two days (minimum one minute); default: one hour |
139
139
| feedback.maxDeliveryCount | Maximum delivery count for the feedback queue | 1 to 100; default: 10 |
140
-
| feedback.lockDurationAsIso8601 | Lock duration for the feedback queue | ISO_8601 interval from 5 to 300 seconds (minimum 5 seconds); default: 60 seconds. |
140
+
| feedback.lockDurationAsIso8601 | Lock duration for the feedback queue | ISO_8601 interval from 5 to 300 seconds (minimum five seconds); default: 60 seconds. |
141
141
142
142
You can set the configuration options in one of the following ways:
0 commit comments