Azure / azure-iot-sdk-c

A C99 SDK for connecting devices to Microsoft Azure IoT services
https://azure.github.io/azure-iot-sdk-c
Other
588 stars 737 forks source link

Cloud-to-Device AMQP messages with IDs of type UUID are rejected #116

Closed peterdn closed 7 years ago

peterdn commented 7 years ago

Description of the issue:

Cloud-to-Device AMQP messages with IDs of type UUID are rejected by the IoTHub Client.

It appears that the readPropertiesFromuAMQPMessage function in uamqp_messaging.c expects the message ID to be a string, even though the AMPQ spec allows it to be ulong, UUID, binary, or string.

This is particularly an issue as the iothub-explorer send command creates messages with IDs of type UUID.

Console log of the issue:

Errors in log output:

In ~/code/caesium-azure-iot-sdks/src/iothub_client/src/uamqp_messaging.c: readPropertiesFromuAMQPMessage: line 242: Failed to get value of uAMQP message 'message-id' property (985).

In ~/code/caesium-azure-iot-sdks/src/iothub_client/src/uamqp_messaging.c: IoTHubMessage_CreateFromUamqpMessage: line 434: Failed reading properties of the uamqp message.
olivierbloch commented 7 years ago

Actually the MessageId is expected to be a string when communicating with Azure IoT Hub as per the doc.