Skip to content

Conversation

@wenyanshi-123
Copy link
Contributor

Based on the actual usage scenarios of customers, write customized MQTT message examples.

Comment on lines 57 to 59
if (payload == null) {
return Collections.emptyList();
return new ArrayList<>();
}
Copy link
Contributor

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");
Copy link
Contributor

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.

Comment on lines +85 to +86
String database = !topic.contains("/") ? topic : topic.substring(0, topic.indexOf("/"));
String table = "test_table";
Copy link
Contributor

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?

Comment on lines +40 to +42
if (payload == null) {
return null;
}
Copy link
Contributor

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.

Comment on lines +44 to +48
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++) {
Copy link
Contributor

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.

Copy link
Contributor

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants