-
Notifications
You must be signed in to change notification settings - Fork 101
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
publish userProperties aren't returned in the PUBACK? #499
Comments
The mqtt5 protocol does not establish any relationship between the user properties of a publish and its associated puback. For Iot Core (and probably every MQTT broker I'm aware of), publish user properties are only reflected in the publish packets sent to subscribers. The only way to do direct correlation between publish and puback is by packet id. Thinking about a persistence storage solution, it seems likely you'll need a system that associates unique ids with publishes and translates completed publish promises back to the persistence id. |
There's no way to fetch this packet ID at the application layer? |
No. We don't allow it as an input so it doesn't make sense as an output. Beyond that, packet ids come from a very small space (16 bits) and will be constantly reused over the course of a connection or session. They would make a terrible persistence key. Making it correct is certainly more complicated than this, but supposing you have a durable key-value store of packets (say uuid -> publish-packet-as-json), it seems that just chaining on to the publish promise with a delete key operation (on success) would be reasonable (pseudocode):
|
Got it- thanks so much :) ! |
This issue is now closed. Comments on closed issues are hard for our team to see. |
Describe the issue
Looking to create a file-persistent queue for MQTT, was hoping to use userProperties to be able to link a publish with a pub ack. However- trying to experiment with this dummy program, the response contains an empty
userProperties
field. Is this the expected behaviour? How else could I go about connecting PUBACK's with their respective publishes?output:
Links
https://aws.github.io/aws-iot-device-sdk-js-v2/node/interfaces/mqtt5.PublishPacket.html#userProperties
The text was updated successfully, but these errors were encountered: