-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Based on the actual usage scenarios of customers, write customized MQTT message examples. #16674
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: master
Are you sure you want to change the base?
Conversation
6685c16 to
fc923af
Compare
…TT message examples
fc923af to
8f238e1
Compare
| if (payload == null) { | ||
| return Collections.emptyList(); | ||
| return new ArrayList<>(); | ||
| } |
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.
Explain this change
| return messages; | ||
| } | ||
| return ret; | ||
| throw new JsonParseException("payload is invalidate"); |
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.
May provide the txt or the jsonElement.
| String database = !topic.contains("/") ? topic : topic.substring(0, topic.indexOf("/")); | ||
| String table = "test_table"; |
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.
May parse the table name from the topic?
| if (payload == null) { | ||
| return null; | ||
| } |
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.
Better to keep consistency between examples.
| String line = payload.toString(StandardCharsets.UTF_8); | ||
| // parse data from the line and generate Messages and put them into List<Meesage> ret | ||
| List<Message> ret = new ArrayList<>(); | ||
| // this is just an example, so we just generate some Messages directly | ||
| for (int i = 0; i < 3; i++) { |
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.
The line should still be used, otherwise, this examples means nothing.
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.
Does this example include both the tree model and the table model? It is recommended to write about both
Based on the actual usage scenarios of customers, write customized MQTT message examples.