Reputation: 13
I already have a cumulocity
client that communicates with the cumulocity
broker through MQTT.
What should I do in order to send data back from MQTT broken in cumulocity
to mqtt
client? (Say the client sends some data and I want the confirmation that the data was sent successfully)
For some reason couldn't find any info on this on the cumulocity
docs the only for client.
Upvotes: 0
Views: 1554
Reputation: 373
You should connect to the broker with Qos 1 or above. This will guarantee that the data has reached the broker at least once. The client will be receiving the PUBACK message once this happens. If the connectivity is lost then the client is supposed to re-send the PUBLISH message with Duplicate flag set. So the cient should stop publishing when a PUBACK is received.
For more information about Qos, refer this link HiveMQ/blog/mqtt-essentials/QualityOfService
Upvotes: 0
Reputation: 2049
If you want to get confirmation from the server of getting your data you should use the normal MQTT QoS. http://cumulocity.com/guides/mqtt/implementation/
If you want to send data in general from the platform to your device client operations is what you are looking for. This is currently the only data you can subscribe to on Cumulocity MQTT. http://cumulocity.com/guides/concepts/domain-model/#operations
You can check the python example. It contains the subscription part http://cumulocity.com/guides/mqtt/hello-mqtt-python/
Upvotes: 2