This is an automated email from the ASF dual-hosted git repository.
critas pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/iotdb-docs.git
The following commit(s) were added to refs/heads/main by this push:
new af36d495 add table mqtt (#712)
af36d495 is described below
commit af36d49578182aaac7cab5e349bf53a43f85ec16
Author: leto-b <[email protected]>
AuthorDate: Tue Apr 22 12:18:06 2025 +0800
add table mqtt (#712)
---
src/.vuepress/public/img/mqtt-table-1.png | Bin 0 -> 146762 bytes
src/.vuepress/public/img/mqtt-table-2.png | Bin 0 -> 230661 bytes
src/.vuepress/public/img/mqtt-table-en-1.png | Bin 0 -> 145422 bytes
src/.vuepress/public/img/mqtt-table-en-2.png | Bin 0 -> 244900 bytes
src/.vuepress/sidebar/V2.0.x/en-Table.ts | 1 +
src/.vuepress/sidebar/V2.0.x/zh-Table.ts | 1 +
src/.vuepress/sidebar_timecho/V2.0.x/en-Table.ts | 1 +
src/.vuepress/sidebar_timecho/V2.0.x/zh-Table.ts | 1 +
src/UserGuide/Master/Table/API/Programming-MQTT.md | 90 ++++++++++++++++++++
src/UserGuide/latest-Table/API/Programming-MQTT.md | 90 ++++++++++++++++++++
.../UserGuide/Master/Table/API/Programming-MQTT.md | 93 +++++++++++++++++++++
.../UserGuide/latest-Table/API/Programming-MQTT.md | 93 +++++++++++++++++++++
12 files changed, 370 insertions(+)
diff --git a/src/.vuepress/public/img/mqtt-table-1.png
b/src/.vuepress/public/img/mqtt-table-1.png
new file mode 100644
index 00000000..8594b964
Binary files /dev/null and b/src/.vuepress/public/img/mqtt-table-1.png differ
diff --git a/src/.vuepress/public/img/mqtt-table-2.png
b/src/.vuepress/public/img/mqtt-table-2.png
new file mode 100644
index 00000000..902228f5
Binary files /dev/null and b/src/.vuepress/public/img/mqtt-table-2.png differ
diff --git a/src/.vuepress/public/img/mqtt-table-en-1.png
b/src/.vuepress/public/img/mqtt-table-en-1.png
new file mode 100644
index 00000000..834f2c54
Binary files /dev/null and b/src/.vuepress/public/img/mqtt-table-en-1.png differ
diff --git a/src/.vuepress/public/img/mqtt-table-en-2.png
b/src/.vuepress/public/img/mqtt-table-en-2.png
new file mode 100644
index 00000000..a8203ecf
Binary files /dev/null and b/src/.vuepress/public/img/mqtt-table-en-2.png differ
diff --git a/src/.vuepress/sidebar/V2.0.x/en-Table.ts
b/src/.vuepress/sidebar/V2.0.x/en-Table.ts
index b21a451a..63272d44 100644
--- a/src/.vuepress/sidebar/V2.0.x/en-Table.ts
+++ b/src/.vuepress/sidebar/V2.0.x/en-Table.ts
@@ -135,6 +135,7 @@ export const enSidebar = {
{ text: 'GO Native API', link: 'Programming-Go-Native-API' },
{ text: 'C# Native API', link: 'Programming-CSharp-Native-API' },
{ text: 'JDBC', link: 'Programming-JDBC_apache' },
+ { text: 'MQTT Protocol', link: 'Programming-MQTT' },
{ text: 'RESTAPI V1 ', link: 'RestAPI-V1' },
],
},
diff --git a/src/.vuepress/sidebar/V2.0.x/zh-Table.ts
b/src/.vuepress/sidebar/V2.0.x/zh-Table.ts
index 8e7956be..e4f95789 100644
--- a/src/.vuepress/sidebar/V2.0.x/zh-Table.ts
+++ b/src/.vuepress/sidebar/V2.0.x/zh-Table.ts
@@ -125,6 +125,7 @@ export const zhSidebar = {
{ text: 'GO原生接口', link: 'Programming-Go-Native-API' },
{ text: 'C#原生接口', link: 'Programming-CSharp-Native-API' },
{ text: 'JDBC', link: 'Programming-JDBC_apache' },
+ { text: 'MQTT协议', link: 'Programming-MQTT' },
{ text: 'RESTAPI V1 ', link: 'RestServiceV1' },
],
},
diff --git a/src/.vuepress/sidebar_timecho/V2.0.x/en-Table.ts
b/src/.vuepress/sidebar_timecho/V2.0.x/en-Table.ts
index 449c819d..2e411665 100644
--- a/src/.vuepress/sidebar_timecho/V2.0.x/en-Table.ts
+++ b/src/.vuepress/sidebar_timecho/V2.0.x/en-Table.ts
@@ -140,6 +140,7 @@ export const enSidebar = {
{ text: 'GO Native API', link: 'Programming-Go-Native-API' },
{ text: 'C# Native API', link: 'Programming-CSharp-Native-API' },
{ text: 'JDBC', link: 'Programming-JDBC_timecho' },
+ { text: 'MQTT Protocol', link: 'Programming-MQTT' },
{ text: 'RESTAPI V1 ', link: 'RestAPI-V1' },
],
},
diff --git a/src/.vuepress/sidebar_timecho/V2.0.x/zh-Table.ts
b/src/.vuepress/sidebar_timecho/V2.0.x/zh-Table.ts
index 27857605..3a5d4e42 100644
--- a/src/.vuepress/sidebar_timecho/V2.0.x/zh-Table.ts
+++ b/src/.vuepress/sidebar_timecho/V2.0.x/zh-Table.ts
@@ -129,6 +129,7 @@ export const zhSidebar = {
{ text: 'GO原生接口', link: 'Programming-Go-Native-API' },
{ text: 'C#原生接口', link: 'Programming-CSharp-Native-API' },
{ text: 'JDBC', link: 'Programming-JDBC_timecho' },
+ { text: 'MQTT协议', link: 'Programming-MQTT' },
{ text: 'RESTAPI V1 ', link: 'RestServiceV1' },
],
},
diff --git a/src/UserGuide/Master/Table/API/Programming-MQTT.md
b/src/UserGuide/Master/Table/API/Programming-MQTT.md
new file mode 100644
index 00000000..e20b3cad
--- /dev/null
+++ b/src/UserGuide/Master/Table/API/Programming-MQTT.md
@@ -0,0 +1,90 @@
+<!--
+
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+
+-->
+# MQTT Protocol
+
+## 1. Overview
+
+MQTT (Message Queuing Telemetry Transport) is a lightweight messaging protocol
designed for IoT and low-bandwidth environments. It operates on a
Publish/Subscribe (Pub/Sub) model, enabling efficient and reliable
bidirectional communication between devices. Its core objectives are low power
consumption, minimal bandwidth usage, and high real-time performance, making it
ideal for unstable networks or resource-constrained scenarios (e.g., sensors,
mobile devices).
+
+IoTDB provides deep integration with the MQTT protocol, fully compliant with
MQTT v3.1 (OASIS International Standard). The IoTDB server includes a built-in
high-performance MQTT Broker module, eliminating the need for third-party
middleware. Devices can directly write time-series data into the IoTDB storage
engine via MQTT messages.
+
+
+
+
+## 2. Configuration
+
+By default, the IoTDB MQTT service loads configurations from
`${IOTDB_HOME}/${IOTDB_CONF}/iotdb-system.properties`.
+
+| **Property** | **Description**
| **Default** |
+| ------------------------ |
----------------------------------------------------------------------------------------------------------------------
| ------------------- |
+| `enable_mqtt_service` | Enable/ disable the MQTT service.
| FALSE
|
+| `mqtt_host` | Host address bound to the MQTT service.
| 127.0.0.1
|
+| `mqtt_port` | Port bound to the MQTT service.
| 1883
|
+| `mqtt_handler_pool_size` | Thread pool size for processing MQTT messages.
| 1
|
+| **`mqtt_payload_formatter`** | **Formatting method for MQTT message
payloads. ****Options: `json` (tree model), `line` (table model).** |
**json** |
+| `mqtt_max_message_size` | Maximum allowed MQTT message size (bytes).
| 1048576
|
+
+## 3. Write Protocol
+
+* Line Protocol Syntax
+
+```JavaScript
+<measurement>[,<tag_key>=<tag_value>[,<tag_key>=<tag_value>]][
<attribute_key>=<attribute_value>[,<attribute_key>=<attribute_value>]]
<field_key>=<field_value>[,<field_key>=<field_value>] [<timestamp>]
+```
+
+* Example
+
+```JavaScript
+myMeasurement,tag1=value1,tag2=value2 attr1=value1,attr2=value2
fieldKey="fieldValue" 1556813561098000000
+```
+
+
+
+## 4. Naming Conventions
+
+* Database Name
+
+The first segment of the MQTT topic (split by `/`) is used as the database
name.
+
+```Properties
+topic: stock/Legacy
+databaseName: stock
+
+
+topic: stock/Legacy/#
+databaseName:stock
+```
+
+* Table Name
+
+The table name is derived from the `<measurement>` in the line protocol.
+
+* Type Identifiers
+
+| Filed Value | IoTDB
Data Type |
+|--------------------------------------------------------------------|
----------------- |
+| 1<br>1.12 | DOUBLE
|
+| 1`f`<br>1.12`f` | FLOAT
|
+| 1`i`<br>123`i` | INT64
|
+| 1`u`<br>123`u` | INT64
|
+| 1`i32`<br>123`i32` | INT32
|
+| `"xxx"` | TEXT
|
+| `t`,`T`,`true`,`True`,`TRUE`<br> `f`,`F`,`false`,`False`,`FALSE` | BOOLEAN
|
diff --git a/src/UserGuide/latest-Table/API/Programming-MQTT.md
b/src/UserGuide/latest-Table/API/Programming-MQTT.md
new file mode 100644
index 00000000..e20b3cad
--- /dev/null
+++ b/src/UserGuide/latest-Table/API/Programming-MQTT.md
@@ -0,0 +1,90 @@
+<!--
+
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+
+-->
+# MQTT Protocol
+
+## 1. Overview
+
+MQTT (Message Queuing Telemetry Transport) is a lightweight messaging protocol
designed for IoT and low-bandwidth environments. It operates on a
Publish/Subscribe (Pub/Sub) model, enabling efficient and reliable
bidirectional communication between devices. Its core objectives are low power
consumption, minimal bandwidth usage, and high real-time performance, making it
ideal for unstable networks or resource-constrained scenarios (e.g., sensors,
mobile devices).
+
+IoTDB provides deep integration with the MQTT protocol, fully compliant with
MQTT v3.1 (OASIS International Standard). The IoTDB server includes a built-in
high-performance MQTT Broker module, eliminating the need for third-party
middleware. Devices can directly write time-series data into the IoTDB storage
engine via MQTT messages.
+
+
+
+
+## 2. Configuration
+
+By default, the IoTDB MQTT service loads configurations from
`${IOTDB_HOME}/${IOTDB_CONF}/iotdb-system.properties`.
+
+| **Property** | **Description**
| **Default** |
+| ------------------------ |
----------------------------------------------------------------------------------------------------------------------
| ------------------- |
+| `enable_mqtt_service` | Enable/ disable the MQTT service.
| FALSE
|
+| `mqtt_host` | Host address bound to the MQTT service.
| 127.0.0.1
|
+| `mqtt_port` | Port bound to the MQTT service.
| 1883
|
+| `mqtt_handler_pool_size` | Thread pool size for processing MQTT messages.
| 1
|
+| **`mqtt_payload_formatter`** | **Formatting method for MQTT message
payloads. ****Options: `json` (tree model), `line` (table model).** |
**json** |
+| `mqtt_max_message_size` | Maximum allowed MQTT message size (bytes).
| 1048576
|
+
+## 3. Write Protocol
+
+* Line Protocol Syntax
+
+```JavaScript
+<measurement>[,<tag_key>=<tag_value>[,<tag_key>=<tag_value>]][
<attribute_key>=<attribute_value>[,<attribute_key>=<attribute_value>]]
<field_key>=<field_value>[,<field_key>=<field_value>] [<timestamp>]
+```
+
+* Example
+
+```JavaScript
+myMeasurement,tag1=value1,tag2=value2 attr1=value1,attr2=value2
fieldKey="fieldValue" 1556813561098000000
+```
+
+
+
+## 4. Naming Conventions
+
+* Database Name
+
+The first segment of the MQTT topic (split by `/`) is used as the database
name.
+
+```Properties
+topic: stock/Legacy
+databaseName: stock
+
+
+topic: stock/Legacy/#
+databaseName:stock
+```
+
+* Table Name
+
+The table name is derived from the `<measurement>` in the line protocol.
+
+* Type Identifiers
+
+| Filed Value | IoTDB
Data Type |
+|--------------------------------------------------------------------|
----------------- |
+| 1<br>1.12 | DOUBLE
|
+| 1`f`<br>1.12`f` | FLOAT
|
+| 1`i`<br>123`i` | INT64
|
+| 1`u`<br>123`u` | INT64
|
+| 1`i32`<br>123`i32` | INT32
|
+| `"xxx"` | TEXT
|
+| `t`,`T`,`true`,`True`,`TRUE`<br> `f`,`F`,`false`,`False`,`FALSE` | BOOLEAN
|
diff --git a/src/zh/UserGuide/Master/Table/API/Programming-MQTT.md
b/src/zh/UserGuide/Master/Table/API/Programming-MQTT.md
new file mode 100644
index 00000000..1ba71f7f
--- /dev/null
+++ b/src/zh/UserGuide/Master/Table/API/Programming-MQTT.md
@@ -0,0 +1,93 @@
+<!--
+
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+
+-->
+# MQTT 协议
+
+## 1. 概述
+
+MQTT
是一种专为物联网(IoT)和低带宽环境设计的轻量级消息传输协议,基于发布/订阅(Pub/Sub)模型,支持设备间高效、可靠的双向通信。其核心目标是低功耗、低带宽消耗和高实时性,尤其适合网络不稳定或资源受限的场景(如传感器、移动设备)。
+
+IoTDB 深度集成了 MQTT 协议能力,完整兼容 MQTT v3.1(OASIS 国际标准协议)。IoTDB 服务器内置高性能 MQTT Broker
服务模块,无需第三方中间件,支持设备通过 MQTT 报文将时序数据直接写入 IoTDB 存储引擎。
+
+
+
+## 2. 配置方式
+
+默认情况下,IoTDB MQTT 服务通过`${IOTDB_HOME}/${IOTDB_CONF}/iotdb-system.properties`加载配置。
+
+具体配置项如下:
+
+| **名称** | **描述**
| **默认** |
+|---------------------------|
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
| ---------------- |
+| `enable_mqtt_service` | 是否启用 mqtt 服务
| FALSE |
+| `mqtt_host` | mqtt 服务绑定主机
| 127.0.0.1 |
+| `mqtt_port` | mqtt 服务绑定端口
| 1883 |
+| `mqtt_handler_pool_size` | 处理 mqtt 消息的处理程序池大小
| 1 |
+| **`mqtt_payload_formatter`** | **mqtt****
消息有效负载格式化程序。****可选项:****`json`****:仅适用于树模型。****`line`****:仅适用于表模型。** |
**json** |
+| `mqtt_max_message_size` | mqtt 消息最大长度(字节)
| 1048576 |
+
+## 3. 写入协议
+
+* 行协议语法格式
+
+```JavaScript
+<measurement>[,<tag_key>=<tag_value>[,<tag_key>=<tag_value>]][
<attribute_key>=<attribute_value>[,<attribute_key>=<attribute_value>]]
<field_key>=<field_value>[,<field_key>=<field_value>] [<timestamp>]
+```
+
+* 示例
+
+```JavaScript
+myMeasurement,tag1=value1,tag2=value2 attr1=value1,attr2=value2
fieldKey="fieldValue" 1556813561098000000
+```
+
+
+
+
+## 4. 命名约定
+
+* 数据库名称
+
+MQTT topic 名称用 `/` 分割后, 第一串内容作为数据库名称。
+
+```Properties
+topic: stock/Legacy
+databaseName: stock
+
+
+topic: stock/Legacy/#
+databaseName:stock
+```
+
+* 表名称
+
+表名称使用行协议中的 `<measurement>`。
+
+* 类型标识
+
+| Filed 内容 | IoTDB 数据类型 |
+|--------------------------------------------------------------|
---------------- |
+| 1<br>1.12 | DOUBLE
|
+| 1`f`<br>1.12`f` | FLOAT
|
+| 1`i`<br>123`i` | INT64
|
+| 1`u`<br>123`u` | INT64|
+| 1`i32`<br>123`i32` | INT32
|
+| `"xxx"` | TEXT
|
+| `t`,`T`,`true`,`True`,`TRUE` <br>`f`,`F`,`false`,`False`,`FALSE` | BOOLEAN
|
+
diff --git a/src/zh/UserGuide/latest-Table/API/Programming-MQTT.md
b/src/zh/UserGuide/latest-Table/API/Programming-MQTT.md
new file mode 100644
index 00000000..1ba71f7f
--- /dev/null
+++ b/src/zh/UserGuide/latest-Table/API/Programming-MQTT.md
@@ -0,0 +1,93 @@
+<!--
+
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+
+-->
+# MQTT 协议
+
+## 1. 概述
+
+MQTT
是一种专为物联网(IoT)和低带宽环境设计的轻量级消息传输协议,基于发布/订阅(Pub/Sub)模型,支持设备间高效、可靠的双向通信。其核心目标是低功耗、低带宽消耗和高实时性,尤其适合网络不稳定或资源受限的场景(如传感器、移动设备)。
+
+IoTDB 深度集成了 MQTT 协议能力,完整兼容 MQTT v3.1(OASIS 国际标准协议)。IoTDB 服务器内置高性能 MQTT Broker
服务模块,无需第三方中间件,支持设备通过 MQTT 报文将时序数据直接写入 IoTDB 存储引擎。
+
+
+
+## 2. 配置方式
+
+默认情况下,IoTDB MQTT 服务通过`${IOTDB_HOME}/${IOTDB_CONF}/iotdb-system.properties`加载配置。
+
+具体配置项如下:
+
+| **名称** | **描述**
| **默认** |
+|---------------------------|
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
| ---------------- |
+| `enable_mqtt_service` | 是否启用 mqtt 服务
| FALSE |
+| `mqtt_host` | mqtt 服务绑定主机
| 127.0.0.1 |
+| `mqtt_port` | mqtt 服务绑定端口
| 1883 |
+| `mqtt_handler_pool_size` | 处理 mqtt 消息的处理程序池大小
| 1 |
+| **`mqtt_payload_formatter`** | **mqtt****
消息有效负载格式化程序。****可选项:****`json`****:仅适用于树模型。****`line`****:仅适用于表模型。** |
**json** |
+| `mqtt_max_message_size` | mqtt 消息最大长度(字节)
| 1048576 |
+
+## 3. 写入协议
+
+* 行协议语法格式
+
+```JavaScript
+<measurement>[,<tag_key>=<tag_value>[,<tag_key>=<tag_value>]][
<attribute_key>=<attribute_value>[,<attribute_key>=<attribute_value>]]
<field_key>=<field_value>[,<field_key>=<field_value>] [<timestamp>]
+```
+
+* 示例
+
+```JavaScript
+myMeasurement,tag1=value1,tag2=value2 attr1=value1,attr2=value2
fieldKey="fieldValue" 1556813561098000000
+```
+
+
+
+
+## 4. 命名约定
+
+* 数据库名称
+
+MQTT topic 名称用 `/` 分割后, 第一串内容作为数据库名称。
+
+```Properties
+topic: stock/Legacy
+databaseName: stock
+
+
+topic: stock/Legacy/#
+databaseName:stock
+```
+
+* 表名称
+
+表名称使用行协议中的 `<measurement>`。
+
+* 类型标识
+
+| Filed 内容 | IoTDB 数据类型 |
+|--------------------------------------------------------------|
---------------- |
+| 1<br>1.12 | DOUBLE
|
+| 1`f`<br>1.12`f` | FLOAT
|
+| 1`i`<br>123`i` | INT64
|
+| 1`u`<br>123`u` | INT64|
+| 1`i32`<br>123`i32` | INT32
|
+| `"xxx"` | TEXT
|
+| `t`,`T`,`true`,`True`,`TRUE` <br>`f`,`F`,`false`,`False`,`FALSE` | BOOLEAN
|
+