MQTT ID suggestion #3233
Replies: 1 comment
-
Please see our documentation, and follow the guidelines in our tutorials. Mongoose is single threaded, our tutorials instruct to catch the ID as soon as the message is published and handled by the user. If there is an actual issue, feel free to open an issue, fill the issue template, and provide us with pertinent information (including useful network capture files; no snapshots, please attach capture files) in order to reproduce and fix the issue. We don't inspect your code for errors, please attach the minimum piece of code that can reproduce the issue. If you post code, please correctly format it so Github shows it as code. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Currently the next available mqtt_id is stored in mg_mgr
if (++c->mgr->mqtt_id == 0) ++c->mgr->mqtt_id;
id = c->mgr->mqtt_id;
The mqtt_id field should be moved to the mqtt_connection structure.
There is no system-wide uniqueness requirement, only unique IDs are required for a given connection.
In high throughput situations, with multiple connections to MQTT brokers, there is a possibility for duplicate IDs if there are too many pending QoS 2 requests in-flight.
Beta Was this translation helpful? Give feedback.
All reactions