@Override
  public List<Message> format(String topic, ByteBuf payload) {
    if (payload == null) {
      return new ArrayList<>();
    }
    String txt = payload.toString(StandardCharsets.UTF_8);
    JsonElement jsonElement = GSON.fromJson(txt, JsonElement.class);
    if (jsonElement.isJsonObject()) {
      JsonObject jsonObject = jsonElement.getAsJsonObject();
      if (jsonObject.get(JSON_KEY_TIMESTAMP) != null) {
        return formatJson(jsonObject);
      }
      if (jsonObject.get(JSON_KEY_TIMESTAMPS) != null) {
        return formatBatchJson(jsonObject);
      }
    } else if (jsonElement.isJsonArray()) {
      JsonArray jsonArray = jsonElement.getAsJsonArray();
      List<Message> messages = new ArrayList<>();
      for (JsonElement element : jsonArray) {
        JsonObject jsonObject = element.getAsJsonObject();
        if (jsonObject.get(JSON_KEY_TIMESTAMP) != null) {
          messages.addAll(formatJson(jsonObject));
        }
        if (jsonObject.get(JSON_KEY_TIMESTAMPS) != null) {
          messages.addAll(formatBatchJson(jsonObject));
        }
      }
      return messages;
    }
    throw new JsonParseException("payload is invalidate");
  }
The JSON payload formatter. two json format supported: { "device":"root.sg.d1",
"timestamp":1586076045524, "measurements":["s1","s2"], "values":[0.530635,0.530635] }

<p>{ "device":"root.sg.d1", "timestamps":[1586076045524,1586076065526],
"measurements":["s1","s2"], "values":[[0.530635,0.530635], [0.530655,0.530695]] }
iotdb-core/datanode/src/main/java/org/apache/iotdb/db/protocol/mqtt/JSONPayloadFormatter.java