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-csharp-csharp-c2d.md
+12-5
Original file line number
Diff line number
Diff line change
@@ -81,13 +81,20 @@ In this section, modify the device app you created in [Send telemetry from a dev
81
81
82
82
The `ReceiveAsync` method asynchronously returns the received message at the time that it is received by the device. It returns *null* after a specifiable timeout period. In this example, the default of one minute is used. When the app receives a *null*, it should continue to wait for new messages. This requirement is the reason for the `if (receivedMessage == null) continue` line.
83
83
84
-
The call to `CompleteAsync()` notifies IoT Hub that the message has been successfully processed. The message can be safely removed from the device queue. If something happened that prevented the device app from completing the processing of the message, IoT Hub delivers it again. The message processing logic in the device app must be *idempotent*, so that receiving the same message multiple times produces the same result.
84
+
The call to `CompleteAsync()` notifies IoT Hub that the message has been successfully processed and that the message can be safely removed from the device queue. The device should call this method when its processing successfully completes regardless of the protocol it's using.
85
85
86
-
An application can also temporarily abandon a message, which results in IoT hub retaining the message in the queue for future consumption. Or the application can reject a message, which permanently removes the message from the queue. For more information about the cloud-to-device message lifecycle, see [D2C and C2D messaging with IoT Hub](iot-hub-devguide-messaging.md).
86
+
With AMQP and HTTPS, but not MQTT, the device can also:
87
87
88
-
> [!NOTE]
89
-
> When using HTTPS instead of MQTT or AMQP as a transport, the `ReceiveAsync` method returns immediately. The supported pattern for cloud-to-device messages with HTTPS is intermittently connected devices that check for messages infrequently (less than every 25 minutes). Issuing more HTTPS receives results in IoT Hub throttling the requests. For more information about the differences between MQTT, AMQP and HTTPS support, and IoT Hub throttling, see [D2C and C2D messaging with IoT Hub](iot-hub-devguide-messaging.md).
90
-
>
88
+
* Abandon a message, which results in IoT Hub retaining the message in the device queue for future consumption.
89
+
* Reject a message, which which permanently removes the message from the device queue.
90
+
91
+
If something happens that prevents the device from completing, abandoning, or rejecting the message, IoT Hub will, after a fixed timeout period, queue the message for delivery again. For this reason, the message processing logic in the device app must be *idempotent*, so that receiving the same message multiple times produces the same result.
92
+
93
+
For more detailed information about how IoT Hub processes cloud-to-device messages, including details of the cloud-to-device message lifecycle, see [Send cloud-to-device messages from an IoT hub](iot-hub-devguide-messages-c2d.md).
94
+
95
+
> [!NOTE]
96
+
> When using HTTPS instead of MQTT or AMQP as a transport, the `ReceiveAsync` method returns immediately. The supported pattern for cloud-to-device messages with HTTPS is intermittently connected devices that check for messages infrequently (a minimum of every 25 minutes). Issuing more HTTPS receives results in IoT Hub throttling the requests. For more information about the differences between MQTT, AMQP, and HTTPS support, see [Cloud-to-device communications guidance](iot-hub-devguide-c2d-guidance.md) and [Choose a communication protocol](iot-hub/iot-hub-devguide-protocols.md).
Copy file name to clipboardExpand all lines: articles/iot-hub/iot-hub-java-java-c2d.md
+14-3
Original file line number
Diff line number
Diff line change
@@ -80,15 +80,26 @@ In this section, you modify the simulated device app you created in [Send teleme
80
80
client.open();
81
81
```
82
82
83
-
> [!NOTE]
84
-
>If you use HTTPS instead of MQTT or AMQP as the transport, the **DeviceClient** instance checks for messages from IoTHub infrequently (less than every 25 minutes).For more information about the differences between MQTT, AMQP and HTTPS support, and IoTHub throttling, see the [messaging section of the IoTHub developer guide](iot-hub-devguide-messaging.md).
85
-
86
83
4.To build the **simulated-device** app using Maven, execute the following command at the command prompt in the simulated-device folder:
87
84
88
85
```cmd/sh
89
86
mvn clean package -DskipTests
90
87
```
91
88
89
+
The `execute` method in the `AppMessageCallback` classreturns `IotHubMessageResult.COMPLETE`. This notifies IoT Hub that the message has been successfully processed and that the message can be safely removed from the device queue. The device should this value when its processing successfully completes regardless of the protocol it's using.
90
+
91
+
With AMQP and HTTPS, but not MQTT, the device can also:
92
+
93
+
* Abandon a message, which results in IoT Hub retaining the message in the device queue for future consumption.
94
+
* Reject a message, which which permanently removes the message from the device queue.
95
+
96
+
If something happens that prevents the device from completing, abandoning, or rejecting the message, IoT Hub will, after a fixed timeout period, queue the message for delivery again. For this reason, the message processing logic in the device app must be *idempotent*, so that receiving the same message multiple times produces the same result.
97
+
98
+
For more detailed information about how IoT Hub processes cloud-to-device messages, including details of the cloud-to-device message lifecycle, see [Send cloud-to-device messages from an IoT hub](iot-hub-devguide-messages-c2d.md).
99
+
100
+
> [!NOTE]
101
+
> If you use HTTPS instead of MQTT or AMQP as the transport, the **DeviceClient** instance checks for messages from IoT Hub infrequently (a minimum of every 25 minutes). For more information about the differences between MQTT, AMQP, and HTTPS support, see [Cloud-to-device communications guidance](iot-hub-devguide-c2d-guidance.md) and [Choose a communication protocol](iot-hub/iot-hub-devguide-protocols.md).
102
+
92
103
## Get the IoT hub connection string
93
104
94
105
In this article you create a backend service to send cloud-to-device messages through the IoT hub you created in [Send telemetry from a device to an IoT hub](quickstart-send-telemetry-java.md). To send cloud-to-device messages, your service needs the **service connect** permission. By default, every IoT Hub is created with a shared access policy named **service** that grants this permission.
Copy file name to clipboardExpand all lines: articles/iot-hub/iot-hub-node-node-c2d.md
+13-4
Original file line number
Diff line number
Diff line change
@@ -69,11 +69,20 @@ In this section, you modify the simulated device app you created in [Send teleme
69
69
});
70
70
```
71
71
72
-
In this example, the device invokes the **complete**function to notify IoT Hub that it has processed the message. The call to **complete** is not required if you are using MQTT transport and can be omitted. It is required for HTTPS and AMQP.
72
+
In this example, the device invokes the **complete**function to notify IoT Hub that it has processed the message and that it can safely be removed from the device queue. The call to **complete** is not required if you are using MQTT transport and can be omitted. It is required for AMQP and HTTPS.
73
+
74
+
With AMQP and HTTPS, but not MQTT, the device can also:
75
+
76
+
* Abandon a message, which results in IoT Hub retaining the message in the device queue for future consumption.
77
+
* Reject a message, which which permanently removes the message from the device queue.
78
+
79
+
If something happens that prevents the device from completing, abandoning, or rejecting the message, IoT Hub will, after a fixed timeout period, queue the message for delivery again. For this reason, the message processing logic in the device app must be *idempotent*, so that receiving the same message multiple times produces the same result.
80
+
81
+
For more detailed information about how IoT Hub processes cloud-to-device messages, including details of the cloud-to-device message lifecycle, see [Send cloud-to-device messages from an IoT hub](iot-hub-devguide-messages-c2d.md).
73
82
74
-
> [!NOTE]
75
-
> If you use HTTPS instead of MQTT or AMQP as the transport, the **DeviceClient** instance checks for messages from IoT Hub infrequently (lessthanevery25minutes). For more information about the differences between MQTT, AMQP and HTTPS support, and IoT Hub throttling, see the [IoT Hub developer guide](iot-hub-devguide-messaging.md).
76
-
>
83
+
> [!NOTE]
84
+
> If you use HTTPS instead of MQTT or AMQP as the transport, the **DeviceClient** instance checks for messages from IoT Hub infrequently (a minimum of every 25 minutes). For more information about the differences between MQTT, AMQP, and HTTPS support, see [Cloud-to-device communications guidance](iot-hub-devguide-c2d-guidance.md) and [Choose a communication protocol](iot-hub/iot-hub-devguide-protocols.md).
0 commit comments