question

DariusKinstler-1226 avatar image
0 Votes"
DariusKinstler-1226 asked TimMyth-0834 commented

IoT-Hub cloud-to-device messages rejected when devices are connected through MQTT

Within a customer subscription, we're running into an issue related to C2D messaging where messages sent to devices connected via the MQTT protocol are sometimes rejected.

The general setup is that all devices (PLCs) are connected to an IoT-Hub via MQTT.
Each device may receive inputs from a related service which uses the ServiceClient class in the Microsoft.Azure.Devices package to send C2D messages.
The IoT-Hub itself is accessed only through a private endpoint and public access is blocked.

Sometimes, the IoT-Hub metrics display rejected messages. However, this shouldn't be possible according to the [relevant documentation][1]. It states:

Devices that connect over the Message Queuing Telemetry Transport (MQTT) Protocol can't reject cloud-to-device messages.

There are no devices connected that use a different protocol.

Are there other possible reasons a C2D message may be rejected?


[1]: https://docs.microsoft.com/en-us/azure/iot-hub/iot-hub-devguide-messages-c2d
azure-iot-hubazure-iot
· 2
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Hello @DariusKinstler-1226 Welcome to Microsoft Q&A Platform and thanks for your query.

Could you please add more info to the question, such as the Azure IoTHub metrics showing the 'Rejected Messages'?
Any logs which can add more clarity to the scenario?

0 Votes 0 ·

@DariusKinstler-1226 I am running in to this exact same issue. It seems the ServiceClient.SendAsync method uses AMQP to send the message (at least, according to the documentation). Devices that connect via AMQP CAN reject messages. The part of this that troubles me is that my device does not mention it supports AMQP, only MQTT and HTTPS. I have yet to figure out how to require the message gets sent with MQTT. Maybe @SatishBoddu-MSFT knows how?


0 Votes 0 ·

0 Answers