提交 3e524d9a 编写于 作者: A Adam Ji

docs: add assignments and seek offset

上级 dfebe434
......@@ -499,6 +499,18 @@ The TMQ is of [futures::Stream](https://docs.rs/futures/latest/futures/stream/in
}
```
Get assignments:
```rust
let assignments = consumer.assignments().await.unwrap();
```
Seek offset:
```rust
consumer.offset_seek(topic, vgroup_id, offset).await;
```
Unsubscribe:
```rust
......@@ -513,7 +525,7 @@ The following parameters can be configured for the TMQ DSN. Only `group.id` is m
- `enable.auto.commit`: Automatically commits. This can be enabled when data consistency is not essential.
- `auto.commit.interval.ms`: Interval for automatic commits.
For more information, see [GitHub sample file](https://github.com/taosdata/taos-connector-rust/blob/main/examples/subscribe.rs).
For more information, see [GitHub sample file](https://github.com/taosdata/TDengine/blob/3.0/docs/examples/rust/nativeexample/examples/subscribe_demo.rs).
For information about other structure APIs, see the [Rust documentation](https://docs.rs/taos).
......
......@@ -502,6 +502,18 @@ TMQ 消息队列是一个 [futures::Stream](https://docs.rs/futures/latest/futur
}
```
获取消费进度:
```rust
let assignments = consumer.assignments().await.unwrap();
```
按照指定的进度消费:
```rust
consumer.offset_seek(topic, vgroup_id, offset).await;
```
停止订阅:
```rust
......@@ -516,7 +528,7 @@ consumer.unsubscribe().await;
- `enable.auto.commit`: 当设置为 `true` 时,将启用自动标记模式,当对数据一致性不敏感时,可以启用此方式。
- `auto.commit.interval.ms`: 自动标记的时间间隔。
完整订阅示例参见 [GitHub 示例文件](https://github.com/taosdata/taos-connector-rust/blob/main/examples/subscribe.rs).
完整订阅示例参见 [GitHub 示例文件](https://github.com/taosdata/TDengine/blob/3.0/docs/examples/rust/nativeexample/examples/subscribe_demo.rs).
其他相关结构体 API 使用说明请移步 Rust 文档托管网页:<https://docs.rs/taos>。
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册