Description
Component
WIth dev1 and APIKEY non provisoned device:
Sending MQTT measures:
$ mosquitto_pub -h localhost -t /json/APIKEY/dev1/attrs -m '[{"v": 55}]' && mosquitto_pub -h localhost -t /json/APIKEY/dev1/attrs -m '[{"v": 45}]'
This duplicates device.
But not when (with a small delay):
$ mosquitto_pub -h localhost -t /json/APIKEY/dev1/attrs -m '[{"v": 55}]' && sleep 0.05 && mosquitto_pub -h localhost -t /json/APIKEY/dev1/attrs -m '[{"v": 45}]'
Sending HTTP measures:
$ curl -i -X POST 'http://localhost:7897/iot/json?i=disp2&k=APIKEY' -d '{ "level": "33"}' -H 'content-type: application/json' & curl -i -X POST 'http://localhost:7897/iot/json?i=disp2&k=APIKEY' -d '{ "level": "44"}' -H 'content-type: application/json'
This duplicates device.
Possible solutions:
- Ensure unique mongo index: willl result in measures reject
- Check findAndCreate to ensure Store device as soon as possible
- A throttle queue
Metadata
Metadata
Assignees
Labels
No labels