From 98e2dfcdc86d72b6fb5a19c4a1da944174ee305a Mon Sep 17 00:00:00 2001
From: sheyanjie-qq <249478495@qq.com>
Date: Sat, 3 Aug 2024 08:52:27 +0800
Subject: [PATCH] remove unsupport connector type
---
docs/zh/08-develop/01-connect/index.md | 22 +------
docs/zh/08-develop/04-schemaless.md | 26 --------
docs/zh/08-develop/05-stmt.md | 3 -
docs/zh/08-develop/07-tmq.md | 84 +++++++++++++++-----------
4 files changed, 50 insertions(+), 85 deletions(-)
diff --git a/docs/zh/08-develop/01-connect/index.md b/docs/zh/08-develop/01-connect/index.md
index 528a30f909..ddf988435d 100644
--- a/docs/zh/08-develop/01-connect/index.md
+++ b/docs/zh/08-develop/01-connect/index.md
@@ -79,7 +79,7 @@ TDengine 提供了丰富的应用程序开发接口,为了便于用户快速
## 安装连接器
-
+
如果使用 Maven 管理项目,只需在 pom.xml 中加入以下依赖。
@@ -439,9 +439,6 @@ DSN 的详细说明和如何使用详见 [连接功能](../../reference/connecto
{{#include docs/examples/csharp/wsConnect/Program.cs:main}}
```
-
-
-
### 原生连接
@@ -496,16 +493,6 @@ DSN 的详细说明和如何使用详见 [连接功能](../../reference/connecto
{{#include docs/examples/go/connect/restexample/main.go}}
```
-
- 不支持
-
-
- 不支持
-
-
-
-
-
@@ -585,11 +572,6 @@ let taos = pool.get()?;
```
-
- 不支持
-
-
-
-
+
diff --git a/docs/zh/08-develop/04-schemaless.md b/docs/zh/08-develop/04-schemaless.md
index f25162a62a..afb622e157 100644
--- a/docs/zh/08-develop/04-schemaless.md
+++ b/docs/zh/08-develop/04-schemaless.md
@@ -204,8 +204,6 @@ writer.write(lineDemo, SchemalessProtocolType.LINE, SchemalessTimestampType.NANO
{{#include docs/examples/csharp/wssml/Program.cs:main}}
```
-
-
### 原生连接
@@ -249,30 +247,6 @@ writer.write(lineDemo, SchemalessProtocolType.LINE, SchemalessTimestampType.NANO
-
-### REST 连接
-
-
- 不支持
-
-
- 不支持
-
-
- 不支持
-
-
- 不支持
-
-
- 不支持
-
-
-
-
-
-
-
## 查询写入的数据
运行上节的样例代码,会在 power 数据库中自动建表,我们可以通过 taos shell 或者应用程序来查询数据。下面给出用 taos shell 查询超级表和 meters 表数据的样例。
diff --git a/docs/zh/08-develop/05-stmt.md b/docs/zh/08-develop/05-stmt.md
index 6cf8149fc6..e24e502a4b 100644
--- a/docs/zh/08-develop/05-stmt.md
+++ b/docs/zh/08-develop/05-stmt.md
@@ -60,9 +60,6 @@ import TabItem from "@theme/TabItem";
```csharp
{{#include docs/examples/csharp/wsStmt/Program.cs:main}}
```
-
-
-
diff --git a/docs/zh/08-develop/07-tmq.md b/docs/zh/08-develop/07-tmq.md
index f148dde9b2..fa6770a29f 100644
--- a/docs/zh/08-develop/07-tmq.md
+++ b/docs/zh/08-develop/07-tmq.md
@@ -145,10 +145,6 @@ Rust 连接器创建消费者的参数为 DSN, 可以设置的参数列表请
```csharp
{{#include docs/examples/csharp/wssubscribe/Program.cs:create_consumer}}
```
-
-
-
-
@@ -160,12 +156,10 @@ Rust 连接器创建消费者的参数为 DSN, 可以设置的参数列表请
-
```java
{{#include examples/JDBC/JDBCDemo/src/main/java/com/taosdata/example/ConsumerLoopFull.java:create_consumer}}
```
-
@@ -255,16 +249,19 @@ TMQ 消息队列是一个 [futures::Stream](https://docs.rs/futures/latest/futur
```
-
-
-
### 原生连接
-同 Websocket 代码样例。
+```java
+{{#include examples/JDBC/JDBCDemo/src/main/java/com/taosdata/example/WsConsumerLoopFull.java:poll_data_code_piece}}
+```
+
+- `subscribe` 方法的参数含义为:订阅的主题列表(即名称),支持同时订阅多个主题。
+- `poll` 每次调用获取一个消息,一个消息中可能包含多个记录。
+- `ResultBean` 是我们自定义的一个内部类,其字段名和数据类型与列的名称和数据类型一一对应,这样根据 `value.deserializer` 属性对应的反序列化类可以反序列化出 `ResultBean` 类型的对象。
@@ -282,7 +279,12 @@ TMQ 消息队列是一个 [futures::Stream](https://docs.rs/futures/latest/futur
-同 Websocket 示例代码
+消费者可订阅一个或多个 `TOPIC`,一般建议一个消费者只订阅一个 `TOPIC`。
+TMQ 消息队列是一个 [futures::Stream](https://docs.rs/futures/latest/futures/stream/index.html) 类型,可以使用相应 API 对每个消息进行消费,并通过 `.commit` 进行已消费标记。
+
+```rust
+{{#include docs/examples/rust/restexample/examples/tmq.rs:consume}}
+```
@@ -353,18 +355,20 @@ TMQ 消息队列是一个 [futures::Stream](https://docs.rs/futures/latest/futur
{{#include docs/examples/csharp/wssubscribe/Program.cs:seek}}
```
-
-
-
-
-
### 原生连接
-同 Websocket 代码样例。
+
+```java
+{{#include examples/JDBC/JDBCDemo/src/main/java/com/taosdata/example/WsConsumerLoopFull.java:consumer_seek}}
+```
+1. 使用 consumer.poll 方法轮询数据,直到获取到数据为止。
+2. 对于轮询到的第一批数据,打印第一条数据的内容,并获取当前消费者的分区分配信息。
+3. 使用 consumer.seekToBeginning 方法将所有分区的偏移量重置到开始位置,并打印成功重置的消息。
+4. 再次使用 consumer.poll 方法轮询数据,并打印第一条数据的内容。
@@ -382,7 +386,17 @@ TMQ 消息队列是一个 [futures::Stream](https://docs.rs/futures/latest/futur
-同 Websocket 代码样例。
+
+```rust
+{{#include docs/examples/rust/nativeexample/examples/tmq.rs:seek_offset}}
+```
+
+1. 通过调用 consumer.assignments() 方法获取消费者当前的分区分配信息,并记录初始分配状态。
+2. 遍历每个分区分配信息,对于每个分区:提取主题(topic)、消费组ID(vgroup_id)、当前偏移量(current)、起始偏移量(begin)和结束偏移量(end)。
+记录这些信息。
+1. 调用 consumer.offset_seek 方法将偏移量设置到起始位置。如果操作失败,记录错误信息和当前分配状态。
+2. 在所有分区的偏移量调整完成后,再次获取并记录消费者的分区分配信息,以确认偏移量调整后的状态。
+
@@ -446,10 +460,6 @@ TMQ 消息队列是一个 [futures::Stream](https://docs.rs/futures/latest/futur
```csharp
{{#include docs/examples/csharp/wssubscribe/Program.cs:commit_offset}}
```
-
-
-
-
@@ -458,7 +468,9 @@ TMQ 消息队列是一个 [futures::Stream](https://docs.rs/futures/latest/futur
-同 Websocket 代码样例。
+```java
+{{#include examples/JDBC/JDBCDemo/src/main/java/com/taosdata/example/WsConsumerLoopFull.java:commit_code_piece}}
+```
@@ -476,7 +488,11 @@ TMQ 消息队列是一个 [futures::Stream](https://docs.rs/futures/latest/futur
-同 Websocket 代码样例。
+```rust
+{{#include docs/examples/rust/restexample/examples/subscribe_demo.rs:consumer_commit_manually}}
+```
+
+可以通过 `consumer.commit` 方法来手工提交消费进度。
@@ -541,19 +557,15 @@ TMQ 消息队列是一个 [futures::Stream](https://docs.rs/futures/latest/futur
{{#include docs/examples/csharp/wssubscribe/Program.cs:close}}
```
-
-
-
-
-
### 原生连接
-同 Websocket 代码样例。
-
+```java
+{{#include examples/JDBC/JDBCDemo/src/main/java/com/taosdata/example/WsConsumerLoopFull.java:unsubscribe_data_code_piece}}
+```
@@ -570,7 +582,11 @@ TMQ 消息队列是一个 [futures::Stream](https://docs.rs/futures/latest/futur
-同 Websocket 代码样例。
+```rust
+{{#include docs/examples/rust/restexample/examples/tmq.rs:unsubscribe}}
+```
+
+**注意**:消费者取消订阅后无法重用,如果想订阅新的 `topic`, 请重新创建消费者。
@@ -638,10 +654,6 @@ TMQ 消息队列是一个 [futures::Stream](https://docs.rs/futures/latest/futur
```
-
-
-
-
### 原生连接