Hello,
I want to set following System Properties of MQTT Message from Non-SDK C client ( I am not using Azure SDK-C but using Open Source MQTT Client written in C) ?
_message-id
user-id
to
correlation-id_
This the simplified code that I use for testing ...
_mqtt_publish((mqtt_broker_handle_t *)TRMqttGetBroker(), "devices/MyDeviceID1/messages/events/MessageId=12&To=myIotHub.azure-devices.net&CorrelationId=0&UserId=MyUserID1&Type=Telemetry&Subtype=Telemetry&Priority=5&Version=1.1.0", "Hello World", 11, 0);_

I can see that my "Application Properties" does get set correctly ... but how to set "System Properties"

When I use Azure C-SDK , these message-id, user-id, to , correlation-id does get set correctly as shown in following image...
Here I am using SDK code as follows -
(void)IoTHubMessage_SetMessageId(messages[iterator].messageHandle, "MSG_ID");
(void)IoTHubMessage_SetCorrelationId(messages[iterator].messageHandle, "CORE_ID");
(void)IoTHubMessage_SetContentTypeSystemProperty(messages[iterator].messageHandle, "application%2Fjson"); (void)IoTHubMessage_SetContentEncodingSystemProperty(messages[iterator].messageHandle, "utf-8");

In Azure documentation , they are talking about "property_bag"
https://docs.microsoft.com/en-us/azure/iot-hub/iot-hub-mqtt-support
and they mention to use $ for System Property but I am not able to use it. Can someone explain how to use it ?

I will appreciate if any help is available.
Thanks,
Kum
Hi @thematrix9 ,
you mention C language, but your screenshots look like from C# code.
Could you clarify about that? If you want c# code you should post your question on https://github.com/Azure/azure-iot-sdk-csharp
You can explore how we do that in the C SDK by looking at this code:
https://github.com/Azure/azure-iot-sdk-c/blob/master/iothub_client/src/iothubtransport_mqtt_common.c#L655
@ewertons this helps https://github.com/Azure/azure-iot-sdk-c/blob/master/iothub_client/src/iothubtransport_mqtt_common.c#L655
Thanks !
Alright, glad to hear that @thematrix9 .
Thanks for using the Azure IoT SDKs.
Most helpful comment
You can explore how we do that in the C SDK by looking at this code:
https://github.com/Azure/azure-iot-sdk-c/blob/master/iothub_client/src/iothubtransport_mqtt_common.c#L655