未验证 提交 162dd3cd 编写于 作者: sangshuduo's avatar sangshuduo 提交者: GitHub

docs: update cloud tmq sample code (#16430)

* docs: update rust cloud tmq sample code

* docs: update rust tmq sample code

* docs: comment off other languages code
上级 58821426
...@@ -9,7 +9,6 @@ import TabItem from "@theme/TabItem"; ...@@ -9,7 +9,6 @@ import TabItem from "@theme/TabItem";
import Java from "./_sub_java.mdx"; import Java from "./_sub_java.mdx";
import Python from "./_sub_python.mdx"; import Python from "./_sub_python.mdx";
import Go from "./_sub_go.mdx"; import Go from "./_sub_go.mdx";
import Rust from "./_sub_rust.mdx";
import Node from "./_sub_node.mdx"; import Node from "./_sub_node.mdx";
import CSharp from "./_sub_cs.mdx"; import CSharp from "./_sub_cs.mdx";
import CDemo from "./_sub_c.mdx"; import CDemo from "./_sub_c.mdx";
...@@ -92,6 +91,8 @@ The method of specifying these parameters depends on the language used: ...@@ -92,6 +91,8 @@ The method of specifying these parameters depends on the language used:
<Tabs defaultValue="java" groupId="lang"> <Tabs defaultValue="java" groupId="lang">
<TabItem value="c" label="C"> <TabItem value="c" label="C">
Will be available soon
<!-- temporarily comment off
```c ```c
/* Create consumer groups on demand (group.id) and enable automatic commits (enable.auto.commit), /* Create consumer groups on demand (group.id) and enable automatic commits (enable.auto.commit),
an automatic commit interval (auto.commit.interval.ms), and a username (td.connect.user) and password (td.connect.pass) */ an automatic commit interval (auto.commit.interval.ms), and a username (td.connect.user) and password (td.connect.pass) */
...@@ -109,10 +110,13 @@ tmq_conf_set_auto_commit_cb(conf, tmq_commit_cb_print, NULL); ...@@ -109,10 +110,13 @@ tmq_conf_set_auto_commit_cb(conf, tmq_commit_cb_print, NULL);
tmq_t* tmq = tmq_consumer_new(conf, NULL, 0); tmq_t* tmq = tmq_consumer_new(conf, NULL, 0);
tmq_conf_destroy(conf); tmq_conf_destroy(conf);
``` ```
-->
</TabItem> </TabItem>
<TabItem value="java" label="Java"> <TabItem value="java" label="Java">
Will be available soon
<!-- temporarily comment off
Java programs use the following parameters: Java programs use the following parameters:
| Parameter | Type | Description | Remarks | | Parameter | Type | Description | Remarks |
...@@ -143,11 +147,14 @@ import com.taosdata.jdbc.tmq.ReferenceDeserializer; ...@@ -143,11 +147,14 @@ import com.taosdata.jdbc.tmq.ReferenceDeserializer;
public class MetersDeserializer extends ReferenceDeserializer<Meters> { public class MetersDeserializer extends ReferenceDeserializer<Meters> {
} }
``` ```
-->
</TabItem> </TabItem>
<TabItem label="Go" value="Go"> <TabItem label="Go" value="Go">
Will be available soon
<!-- temporarily comment off
```go ```go
config := tmq.NewConfig() config := tmq.NewConfig()
defer config.Destroy() defer config.Destroy()
...@@ -194,13 +201,14 @@ if err != nil { ...@@ -194,13 +201,14 @@ if err != nil {
panic(err) panic(err)
} }
``` ```
-->
</TabItem> </TabItem>
<TabItem label="Rust" value="Rust"> <TabItem label="Rust" value="Rust">
```rust ```rust
let mut dsn: Dsn = "taos://".parse()?; let mut dsn = std::env::var("TDENGINE_CLOUD_DSN").parse()?;
dsn.set("group.id", "group1"); dsn.set("group.id", "group1");
dsn.set("client.id", "test"); dsn.set("client.id", "test");
dsn.set("auto.offset.reset", "earliest"); dsn.set("auto.offset.reset", "earliest");
...@@ -214,6 +222,8 @@ let mut consumer = tmq.build()?; ...@@ -214,6 +222,8 @@ let mut consumer = tmq.build()?;
<TabItem value="Python" label="Python"> <TabItem value="Python" label="Python">
Will be available soon
<!-- temporarily comment off
Python programs use the following parameters: Python programs use the following parameters:
| Parameter | Type | Description | Remarks | | Parameter | Type | Description | Remarks |
...@@ -233,9 +243,12 @@ Python programs use the following parameters: ...@@ -233,9 +243,12 @@ Python programs use the following parameters:
| `timeout` | int | Consumer pull timeout | | | `timeout` | int | Consumer pull timeout | |
</TabItem> </TabItem>
-->
<TabItem label="Node.JS" value="Node.JS"> <TabItem label="Node.JS" value="Node.JS">
Will be available soon
<!-- temporarily comment off
```js ```js
// Create consumer groups on demand (group.id) and enable automatic commits (enable.auto.commit), // Create consumer groups on demand (group.id) and enable automatic commits (enable.auto.commit),
// an automatic commit interval (auto.commit.interval.ms), and a username (td.connect.user) and password (td.connect.pass) // an automatic commit interval (auto.commit.interval.ms), and a username (td.connect.user) and password (td.connect.pass)
...@@ -252,11 +265,14 @@ let consumer = taos.consumer({ ...@@ -252,11 +265,14 @@ let consumer = taos.consumer({
'td.connect.port','6030' 'td.connect.port','6030'
}); });
``` ```
-->
</TabItem> </TabItem>
<TabItem value="C#" label="C#"> <TabItem value="C#" label="C#">
Will be available soon
<!-- temporarily comment off
```csharp ```csharp
using TDengineTMQ; using TDengineTMQ;
...@@ -278,6 +294,7 @@ var cfg = new ConsumerConfig ...@@ -278,6 +294,7 @@ var cfg = new ConsumerConfig
var consumer = new ConsumerBuilder(cfg).Build(); var consumer = new ConsumerBuilder(cfg).Build();
``` ```
-->
</TabItem> </TabItem>
...@@ -292,6 +309,8 @@ A single consumer can subscribe to multiple topics. ...@@ -292,6 +309,8 @@ A single consumer can subscribe to multiple topics.
<Tabs defaultValue="java" groupId="lang"> <Tabs defaultValue="java" groupId="lang">
<TabItem value="c" label="C"> <TabItem value="c" label="C">
Will be available soon
<!-- temporarily comment off
```c ```c
// Create a list of subscribed topics // Create a list of subscribed topics
tmq_list_t* topicList = tmq_list_new(); tmq_list_t* topicList = tmq_list_new();
...@@ -301,19 +320,25 @@ tmq_subscribe(tmq, topicList); ...@@ -301,19 +320,25 @@ tmq_subscribe(tmq, topicList);
tmq_list_destroy(topicList); tmq_list_destroy(topicList);
``` ```
-->
</TabItem> </TabItem>
<TabItem value="java" label="Java"> <TabItem value="java" label="Java">
Will be available soon
<!-- temporarily comment off
```java ```java
List<String> topics = new ArrayList<>(); List<String> topics = new ArrayList<>();
topics.add("tmq_topic"); topics.add("tmq_topic");
consumer.subscribe(topics); consumer.subscribe(topics);
``` ```
-->
</TabItem> </TabItem>
<TabItem value="Go" label="Go"> <TabItem value="Go" label="Go">
Will be available soon
<!-- temporarily comment off
```go ```go
consumer, err := tmq.NewConsumer(config) consumer, err := tmq.NewConsumer(config)
if err != nil { if err != nil {
...@@ -324,6 +349,7 @@ if err != nil { ...@@ -324,6 +349,7 @@ if err != nil {
panic(err) panic(err)
} }
``` ```
-->
</TabItem> </TabItem>
<TabItem value="Rust" label="Rust"> <TabItem value="Rust" label="Rust">
...@@ -336,14 +362,19 @@ consumer.subscribe(["tmq_meters"]).await?; ...@@ -336,14 +362,19 @@ consumer.subscribe(["tmq_meters"]).await?;
<TabItem value="Python" label="Python"> <TabItem value="Python" label="Python">
Will be available soon
<!-- temporarily comment off
```python ```python
consumer = TaosConsumer('topic_ctb_column', group_id='vg2') consumer = TaosConsumer('topic_ctb_column', group_id='vg2')
``` ```
-->
</TabItem> </TabItem>
<TabItem label="Node.JS" value="Node.JS"> <TabItem label="Node.JS" value="Node.JS">
Will be available soon
<!-- temporarily comment off
```js ```js
// Create a list of subscribed topics // Create a list of subscribed topics
let topics = ['topic_test'] let topics = ['topic_test']
...@@ -351,11 +382,14 @@ let topics = ['topic_test'] ...@@ -351,11 +382,14 @@ let topics = ['topic_test']
// Enable subscription // Enable subscription
consumer.subscribe(topics); consumer.subscribe(topics);
``` ```
-->
</TabItem> </TabItem>
<TabItem value="C#" label="C#"> <TabItem value="C#" label="C#">
Will be available soon
<!-- temporarily comment off
```csharp ```csharp
// Create a list of subscribed topics // Create a list of subscribed topics
List<String> topics = new List<string>(); List<String> topics = new List<string>();
...@@ -363,6 +397,7 @@ topics.add("tmq_topic"); ...@@ -363,6 +397,7 @@ topics.add("tmq_topic");
// Enable subscription // Enable subscription
consumer.Subscribe(topics); consumer.Subscribe(topics);
``` ```
-->
</TabItem> </TabItem>
...@@ -375,6 +410,8 @@ The following code demonstrates how to consume the messages in a queue. ...@@ -375,6 +410,8 @@ The following code demonstrates how to consume the messages in a queue.
<Tabs defaultValue="java" groupId="lang"> <Tabs defaultValue="java" groupId="lang">
<TabItem value="c" label="C"> <TabItem value="c" label="C">
Will be available soon
<!-- temporarily comment off
```c ```c
## Consume data ## Consume data
while (running) { while (running) {
...@@ -384,10 +421,13 @@ while (running) { ...@@ -384,10 +421,13 @@ while (running) {
``` ```
The `while` loop obtains a message each time it calls `tmq_consumer_poll()`. This message is exactly the same as the result returned by a query, and the same deserialization API can be used on it. The `while` loop obtains a message each time it calls `tmq_consumer_poll()`. This message is exactly the same as the result returned by a query, and the same deserialization API can be used on it.
-->
</TabItem> </TabItem>
<TabItem value="java" label="Java"> <TabItem value="java" label="Java">
Will be available soon
<!-- temporarily comment off
```java ```java
while(running){ while(running){
ConsumerRecords<Meters> meters = consumer.poll(Duration.ofMillis(100)); ConsumerRecords<Meters> meters = consumer.poll(Duration.ofMillis(100));
...@@ -396,11 +436,14 @@ while(running){ ...@@ -396,11 +436,14 @@ while(running){
} }
} }
``` ```
-->
</TabItem> </TabItem>
<TabItem value="Go" label="Go"> <TabItem value="Go" label="Go">
Will be available soon
<!-- temporarily comment off
```go ```go
for { for {
result, err := consumer.Poll(time.Second) result, err := consumer.Poll(time.Second)
...@@ -412,6 +455,7 @@ for { ...@@ -412,6 +455,7 @@ for {
consumer.FreeMessage(result.Message) consumer.FreeMessage(result.Message)
} }
``` ```
-->
</TabItem> </TabItem>
...@@ -450,17 +494,22 @@ for { ...@@ -450,17 +494,22 @@ for {
</TabItem> </TabItem>
<TabItem value="Python" label="Python"> <TabItem value="Python" label="Python">
Will be available soon
<!-- temporarily comment off
```python ```python
for msg in consumer: for msg in consumer:
for row in msg: for row in msg:
print(row) print(row)
``` ```
-->
</TabItem> </TabItem>
<TabItem label="Node.JS" value="Node.JS"> <TabItem label="Node.JS" value="Node.JS">
Will be available soon
<!-- temporarily comment off
```js ```js
while(true){ while(true){
msg = consumer.consume(200); msg = consumer.consume(200);
...@@ -470,11 +519,14 @@ while(true){ ...@@ -470,11 +519,14 @@ while(true){
console.log(msg.fields) console.log(msg.fields)
} }
``` ```
-->
</TabItem> </TabItem>
<TabItem value="C#" label="C#"> <TabItem value="C#" label="C#">
Will be available soon
<!-- temporarily comment off
```csharp ```csharp
## Consume data ## Consume data
while (true) while (true)
...@@ -485,6 +537,7 @@ while (true) ...@@ -485,6 +537,7 @@ while (true)
consumer.Commit(consumerRes); consumer.Commit(consumerRes);
} }
``` ```
-->
</TabItem> </TabItem>
...@@ -496,6 +549,8 @@ A single consumer can subscribe to multiple topics. ...@@ -496,6 +549,8 @@ A single consumer can subscribe to multiple topics.
<Tabs defaultValue="java" groupId="lang"> <Tabs defaultValue="java" groupId="lang">
<TabItem value="c" label="C"> <TabItem value="c" label="C">
Will be available soon
<!-- temporarily comment off
```c ```c
// Create a list of subscribed topics // Create a list of subscribed topics
...@@ -506,19 +561,25 @@ tmq_subscribe(tmq, topicList); ...@@ -506,19 +561,25 @@ tmq_subscribe(tmq, topicList);
tmq_list_destroy(topicList); tmq_list_destroy(topicList);
``` ```
-->
</TabItem> </TabItem>
<TabItem value="java" label="Java"> <TabItem value="java" label="Java">
Will be available soon
<!-- temporarily comment off
```java ```java
List<String> topics = new ArrayList<>(); List<String> topics = new ArrayList<>();
topics.add("tmq_topic"); topics.add("tmq_topic");
consumer.subscribe(topics); consumer.subscribe(topics);
``` ```
-->
</TabItem> </TabItem>
<TabItem value="Go" label="Go"> <TabItem value="Go" label="Go">
Will be available soon
<!-- temporarily comment off
```go ```go
consumer, err := tmq.NewConsumer(config) consumer, err := tmq.NewConsumer(config)
if err != nil { if err != nil {
...@@ -529,6 +590,7 @@ if err != nil { ...@@ -529,6 +590,7 @@ if err != nil {
panic(err) panic(err)
} }
``` ```
-->
</TabItem> </TabItem>
<TabItem value="Rust" label="Rust"> <TabItem value="Rust" label="Rust">
...@@ -540,13 +602,18 @@ consumer.subscribe(["tmq_meters"]).await?; ...@@ -540,13 +602,18 @@ consumer.subscribe(["tmq_meters"]).await?;
</TabItem> </TabItem>
<TabItem value="Python" label="Python"> <TabItem value="Python" label="Python">
Will be available soon
<!-- temporarily comment off
```python ```python
consumer = TaosConsumer('topic_ctb_column', group_id='vg2') consumer = TaosConsumer('topic_ctb_column', group_id='vg2')
``` ```
-->
</TabItem> </TabItem>
Will be available soon
<!-- temporarily comment off
<TabItem label="Node.JS" value="Node.JS"> <TabItem label="Node.JS" value="Node.JS">
```js ```js
...@@ -556,10 +623,13 @@ let topics = ['topic_test'] ...@@ -556,10 +623,13 @@ let topics = ['topic_test']
// Enable subscription // Enable subscription
consumer.subscribe(topics); consumer.subscribe(topics);
``` ```
-->
</TabItem> </TabItem>
<TabItem value="C#" label="C#"> <TabItem value="C#" label="C#">
Will be available soon
<!-- temporarily comment off
```csharp ```csharp
// Create a list of subscribed topics // Create a list of subscribed topics
...@@ -568,6 +638,7 @@ topics.add("tmq_topic"); ...@@ -568,6 +638,7 @@ topics.add("tmq_topic");
// Enable subscription // Enable subscription
consumer.Subscribe(topics); consumer.Subscribe(topics);
``` ```
-->
</TabItem> </TabItem>
...@@ -581,6 +652,8 @@ The following code demonstrates how to consume the messages in a queue. ...@@ -581,6 +652,8 @@ The following code demonstrates how to consume the messages in a queue.
<Tabs defaultValue="java" groupId="lang"> <Tabs defaultValue="java" groupId="lang">
<TabItem value="c" label="C"> <TabItem value="c" label="C">
Will be available soon
<!-- temporarily comment off
```c ```c
## Consume data ## Consume data
while (running) { while (running) {
...@@ -588,12 +661,15 @@ while (running) { ...@@ -588,12 +661,15 @@ while (running) {
msg_process(msg); msg_process(msg);
} }
``` ```
-->
The `while` loop obtains a message each time it calls `tmq_consumer_poll()`. This message is exactly the same as the result returned by a query, and the same deserialization API can be used on it. The `while` loop obtains a message each time it calls `tmq_consumer_poll()`. This message is exactly the same as the result returned by a query, and the same deserialization API can be used on it.
</TabItem> </TabItem>
<TabItem value="java" label="Java"> <TabItem value="java" label="Java">
Will be available soon
<!-- temporarily comment off
```java ```java
while(running){ while(running){
ConsumerRecords<Meters> meters = consumer.poll(Duration.ofMillis(100)); ConsumerRecords<Meters> meters = consumer.poll(Duration.ofMillis(100));
...@@ -602,11 +678,14 @@ while(running){ ...@@ -602,11 +678,14 @@ while(running){
} }
} }
``` ```
-->
</TabItem> </TabItem>
<TabItem value="Go" label="Go"> <TabItem value="Go" label="Go">
Will be available soon
<!-- temporarily comment off
```go ```go
for { for {
result, err := consumer.Poll(time.Second) result, err := consumer.Poll(time.Second)
...@@ -618,6 +697,7 @@ for { ...@@ -618,6 +697,7 @@ for {
consumer.FreeMessage(result.Message) consumer.FreeMessage(result.Message)
} }
``` ```
-->
</TabItem> </TabItem>
...@@ -656,17 +736,22 @@ for { ...@@ -656,17 +736,22 @@ for {
</TabItem> </TabItem>
<TabItem value="Python" label="Python"> <TabItem value="Python" label="Python">
Will be available soon
<!-- temporarily comment off
```python ```python
for msg in consumer: for msg in consumer:
for row in msg: for row in msg:
print(row) print(row)
``` ```
-->
</TabItem> </TabItem>
<TabItem label="Node.JS" value="Node.JS"> <TabItem label="Node.JS" value="Node.JS">
Will be available soon
<!-- temporarily comment off
```js ```js
while(true){ while(true){
msg = consumer.consume(200); msg = consumer.consume(200);
...@@ -676,11 +761,14 @@ while(true){ ...@@ -676,11 +761,14 @@ while(true){
console.log(msg.fields) console.log(msg.fields)
} }
``` ```
-->
</TabItem> </TabItem>
<TabItem value="C#" label="C#"> <TabItem value="C#" label="C#">
Will be available soon
<!-- temporarily comment off
```csharp ```csharp
## Consume data ## Consume data
while (true) while (true)
...@@ -692,6 +780,7 @@ while (true) ...@@ -692,6 +780,7 @@ while (true)
} }
``` ```
-->
</TabItem> </TabItem>
</Tabs> </Tabs>
...@@ -703,6 +792,8 @@ After message consumption is finished, the consumer is unsubscribed. ...@@ -703,6 +792,8 @@ After message consumption is finished, the consumer is unsubscribed.
<Tabs defaultValue="java" groupId="lang"> <Tabs defaultValue="java" groupId="lang">
<TabItem value="c" label="C"> <TabItem value="c" label="C">
Will be available soon
<!-- temporarily comment off
```c ```c
/* Unsubscribe */ /* Unsubscribe */
tmq_unsubscribe(tmq); tmq_unsubscribe(tmq);
...@@ -711,9 +802,12 @@ tmq_unsubscribe(tmq); ...@@ -711,9 +802,12 @@ tmq_unsubscribe(tmq);
tmq_consumer_close(tmq); tmq_consumer_close(tmq);
``` ```
-->
</TabItem> </TabItem>
<TabItem value="java" label="Java"> <TabItem value="java" label="Java">
Will be available soon
<!-- temporarily comment off
```java ```java
/* Unsubscribe */ /* Unsubscribe */
consumer.unsubscribe(); consumer.unsubscribe();
...@@ -721,14 +815,18 @@ consumer.unsubscribe(); ...@@ -721,14 +815,18 @@ consumer.unsubscribe();
/* Close consumer */ /* Close consumer */
consumer.close(); consumer.close();
``` ```
-->
</TabItem> </TabItem>
<TabItem value="Go" label="Go"> <TabItem value="Go" label="Go">
Will be available soon
<!-- temporarily comment off
```go ```go
consumer.Close() consumer.Close()
``` ```
-->
</TabItem> </TabItem>
...@@ -742,24 +840,32 @@ consumer.unsubscribe().await; ...@@ -742,24 +840,32 @@ consumer.unsubscribe().await;
<TabItem value="Python" label="Python"> <TabItem value="Python" label="Python">
Will be available soon
<!-- temporarily comment off
```py ```py
# Unsubscribe # Unsubscribe
consumer.unsubscribe() consumer.unsubscribe()
# Close consumer # Close consumer
consumer.close() consumer.close()
``` ```
-->
</TabItem> </TabItem>
<TabItem label="Node.JS" value="Node.JS"> <TabItem label="Node.JS" value="Node.JS">
Will be available soon
<!-- temporarily comment off
```js ```js
consumer.unsubscribe(); consumer.unsubscribe();
consumer.close(); consumer.close();
``` ```
-->
</TabItem> </TabItem>
<TabItem value="C#" label="C#"> <TabItem value="C#" label="C#">
Will be available soon
<!-- temporarily comment off
```csharp ```csharp
// Unsubscribe // Unsubscribe
...@@ -768,6 +874,7 @@ consumer.Unsubscribe(); ...@@ -768,6 +874,7 @@ consumer.Unsubscribe();
// Close consumer // Close consumer
consumer.Close(); consumer.Close();
``` ```
-->
</TabItem> </TabItem>
...@@ -780,6 +887,8 @@ After message consumption is finished, the consumer is unsubscribed. ...@@ -780,6 +887,8 @@ After message consumption is finished, the consumer is unsubscribed.
<Tabs defaultValue="java" groupId="lang"> <Tabs defaultValue="java" groupId="lang">
<TabItem value="c" label="C"> <TabItem value="c" label="C">
Will be available soon
<!-- temporarily comment off
```c ```c
/* Unsubscribe */ /* Unsubscribe */
...@@ -788,10 +897,13 @@ tmq_unsubscribe(tmq); ...@@ -788,10 +897,13 @@ tmq_unsubscribe(tmq);
/* Close consumer object */ /* Close consumer object */
tmq_consumer_close(tmq); tmq_consumer_close(tmq);
``` ```
-->
</TabItem> </TabItem>
<TabItem value="java" label="Java"> <TabItem value="java" label="Java">
Will be available soon
<!-- temporarily comment off
```java ```java
/* Unsubscribe */ /* Unsubscribe */
consumer.unsubscribe(); consumer.unsubscribe();
...@@ -799,14 +911,18 @@ consumer.unsubscribe(); ...@@ -799,14 +911,18 @@ consumer.unsubscribe();
/* Close consumer */ /* Close consumer */
consumer.close(); consumer.close();
``` ```
-->
</TabItem> </TabItem>
<TabItem value="Go" label="Go"> <TabItem value="Go" label="Go">
Will be available soon
<!-- temporarily comment off
```go ```go
consumer.Close() consumer.Close()
``` ```
-->
</TabItem> </TabItem>
...@@ -819,6 +935,8 @@ consumer.unsubscribe().await; ...@@ -819,6 +935,8 @@ consumer.unsubscribe().await;
</TabItem> </TabItem>
<TabItem value="Python" label="Python"> <TabItem value="Python" label="Python">
Will be available soon
<!-- temporarily comment off
```py ```py
# Unsubscribe # Unsubscribe
...@@ -826,18 +944,24 @@ consumer.unsubscribe() ...@@ -826,18 +944,24 @@ consumer.unsubscribe()
# Close consumer # Close consumer
consumer.close() consumer.close()
``` ```
-->
</TabItem> </TabItem>
<TabItem label="Node.JS" value="Node.JS"> <TabItem label="Node.JS" value="Node.JS">
Will be available soon
<!-- temporarily comment off
```js ```js
consumer.unsubscribe(); consumer.unsubscribe();
consumer.close(); consumer.close();
``` ```
-->
</TabItem> </TabItem>
<TabItem value="C#" label="C#"> <TabItem value="C#" label="C#">
Will be available soon
<!-- temporarily comment off
```csharp ```csharp
// Unsubscribe // Unsubscribe
...@@ -846,6 +970,7 @@ consumer.Unsubscribe(); ...@@ -846,6 +970,7 @@ consumer.Unsubscribe();
// Close consumer // Close consumer
consumer.Close(); consumer.Close();
``` ```
-->
</TabItem> </TabItem>
...@@ -876,4 +1001,4 @@ SHOW TOPICS; ...@@ -876,4 +1001,4 @@ SHOW TOPICS;
```sql ```sql
SHOW CONSUMERS; SHOW CONSUMERS;
``` ```
\ No newline at end of file
...@@ -35,7 +35,7 @@ async fn prepare(taos: Taos) -> anyhow::Result<()> { ...@@ -35,7 +35,7 @@ async fn prepare(taos: Taos) -> anyhow::Result<()> {
#[tokio::main] #[tokio::main]
async fn main() -> anyhow::Result<()> { async fn main() -> anyhow::Result<()> {
let dsn = "taosws://localhost:6030"; let mut dsn = std::env::var("TDENGINE_CLOUD_DSN").parse()?;
let builder = TaosBuilder::from_dsn(dsn)?; let builder = TaosBuilder::from_dsn(dsn)?;
let taos = builder.build()?; let taos = builder.build()?;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册