Updating Properties
Properties can be updated by sending outgoing (egress) messages from a ThingWorx Platform to the Azure IoT devices via the Azure IoT Hub Connector. Conversely, the Azure IoT devices can send messages via their Azure IoT Hub to the Connector, which forwards them on to a ThingWorx Platform. The direction of the messages is described from the perspective of the ThingWorx Platform. Incoming or ingress messages are sent from remote devices to a Connector, which translates them and forwards them to a ThingWorx Platform. Outgoing or egress messages are sent from the platform to remote devices. In Azure IoT parlance, ingress messages are Device-to-Cloud messages while egress messages are Cloud-to-Device messages.
Egress Messages: Writing Multiple Properties in One Message
Pushing egress from the ThingWorx Platform through property updates (writes) generates one message from the Connector to the Azure IoT Hub per property change. This process can be costly if each device has hundreds of properties. To make property updates more efficient there is a service that allows for multiple property updates per message, namely the AzureIotSendMessage service.
The AzureIotSendMessage service takes a thingName (deviceId) and a payload that is formatted as an infotable. When this service is called on a ThingWorx Platform, the Connector transforms the infotable into JSON and sends the full contents to the designated edge device. Once the property updates have been sent to the edge device, it is the responsibility of the edge device application to consume the property writes and reflect the new property values back to ThingWorx through ingress messages (Device-to-Cloud messages).