-
Notifications
You must be signed in to change notification settings - Fork 94
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
How about adding hook for PUBXXX messages #40
Comments
What are you thinking of doing with the hooks? Puback and other such packets are really for the protocol and implementations rather than users. |
The publish hook is before messages are sent to allow the user of the library to modify them, and currently to provide automatic topic aliasing. |
Thank you for reply! I am currently developing an MQTT broker with its own extension specification. I would like to return additional information defined in the extension specification to the MQTT broker using UserProperty in PubAck, PubRec or PubComp messages. However, there seems to be no library that has hooks like I proposed. If this library could support such hooks, it would save me a lot of time and effort to develop a client that supports the extension specifications. |
I've been thinking about this, on the one hand this opens up a whole load of possibilities that weren't previously possible, and I don't think were imagined when the spec was put together, it will be quite possible to create tight coupling between an application and a specific broker. |
Well, as no one else has responded I will have a go at adding this and see how it looks/feels. Not going to guarantee that I won't remove it in the future if I decide I don't like it :) |
Dear maintainers,
Is your feature request related to a problem? Please describe.
I want to set user properties on PUBACK, PUBREC, PUBREL and PUBCOMP.
Describe the solution you'd like
How about adding a hook function to ClientConfig like:
And this hook will be defined like:
Then this hook can be used here:
https://github.com/eclipse/paho.golang/blob/76a1f9a081d13c3e6da7706c7dd3e24c8139d82c/paho/client.go#L315
like:
Thanks,
Ryosuke
The text was updated successfully, but these errors were encountered: