-
Notifications
You must be signed in to change notification settings - Fork 7.6k
shell: mqtt: use topic levels #92677
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
base: main
Are you sure you want to change the base?
shell: mqtt: use topic levels #92677
Conversation
e6a8228
to
248510b
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't mind the change but this will be breaking users so needs to be mentioned in the migration guide.
Bonus points if:
- you consider adding some documentation for the MQTT backend in https://docs.zephyrproject.org/latest/services/shell/index.html#backends (of course this would be a different PR, not asking you to do it here)
- you consider making the topics being used something that can be configured via Kconfig, since things are pretty inflexible at the moment, as your PR basically highlights. I would argue this could/should be done in this very PR since it would effectively make this change non-breaking for folks if you keep the same default value as before.
Thanks!
Since 4.2 hard freeze is tomorrow and there no 4.3 release files I created #92961 |
Thank you for your review and insightful feedback @kartben .
I think it is difficult to make something that is backward compatible and still follow MQTT best practice. I would like to have The backward compatible solution would be to make only two Kconfig which would have shared MQTT levels:
Which is less granular. Semi-related: I think there is a need for a common MQTT topic device identifier in Kconfig somewhere, so everything that uses MQTT has the same identifier. |
248510b
to
b7c4db2
Compare
Change topic from <device_id>_rx (and tx) to <device_id>/sh/rx. This allows use of wildcards. E.g. subscribe to all devices "+/sh/tx". Level "sh" is added to the topic to make it less generic and prevent potential clashes with other topics. Signed-off-by: Jeppe Odgaard <jeppe.odgaard@prevas.dk>
b7c4db2
to
a7d2f80
Compare
Please retry analysis of this Pull-Request directly on SonarQube Cloud |
Change topic from <device_id>_rx (and tx) to <device_id>/sh/rx.
This allows use of wildcards. E.g. subscribe to all devices "+/sh/tx".
Level "sh" is added to the topic to make it less generic and prevent potential clashes with other topics.