diff --git a/docs/en/09-data-out/02-tmq.md b/docs/en/09-data-out/02-tmq.md index d3fb4760685b6be8e094a29461408b91a302835b..6a2fd1f097741c60a532799a0ee3f1f8a771f746 100644 --- a/docs/en/09-data-out/02-tmq.md +++ b/docs/en/09-data-out/02-tmq.md @@ -9,7 +9,6 @@ import TabItem from "@theme/TabItem"; import Java from "./_sub_java.mdx"; import Python from "./_sub_python.mdx"; import Go from "./_sub_go.mdx"; -import Rust from "./_sub_rust.mdx"; import Node from "./_sub_node.mdx"; import CSharp from "./_sub_cs.mdx"; import CDemo from "./_sub_c.mdx"; @@ -92,6 +91,8 @@ The method of specifying these parameters depends on the language used: +Will be available soon + +Will be available soon + +Will be available soon + ```rust -let mut dsn: Dsn = "taos://".parse()?; +let mut dsn = std::env::var("TDENGINE_CLOUD_DSN").parse()?; dsn.set("group.id", "group1"); dsn.set("client.id", "test"); dsn.set("auto.offset.reset", "earliest"); @@ -214,6 +222,8 @@ let mut consumer = tmq.build()?; +Will be available soon + +Will be available soon + +Will be available soon + @@ -292,6 +309,8 @@ A single consumer can subscribe to multiple topics. +Will be available soon + +Will be available soon + +Will be available soon + @@ -336,14 +362,19 @@ consumer.subscribe(["tmq_meters"]).await?; +Will be available soon + +Will be available soon + +Will be available soon + @@ -375,6 +410,8 @@ The following code demonstrates how to consume the messages in a queue. +Will be available soon + +Will be available soon + +Will be available soon + @@ -450,17 +494,22 @@ for { +Will be available soon + +Will be available soon + +Will be available soon + @@ -496,6 +549,8 @@ A single consumer can subscribe to multiple topics. +Will be available soon + +Will be available soon + +Will be available soon + @@ -540,13 +602,18 @@ consumer.subscribe(["tmq_meters"]).await?; +Will be available soon + +Will be available soon + +Will be available soon + @@ -581,6 +652,8 @@ The following code demonstrates how to consume the messages in a queue. +Will be available soon + 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. +Will be available soon + +Will be available soon + @@ -656,17 +736,22 @@ for { +Will be available soon + +Will be available soon + +Will be available soon + @@ -703,6 +792,8 @@ After message consumption is finished, the consumer is unsubscribed. +Will be available soon + +Will be available soon + +Will be available soon + @@ -742,24 +840,32 @@ consumer.unsubscribe().await; +Will be available soon + +Will be available soon + +Will be available soon + @@ -780,6 +887,8 @@ After message consumption is finished, the consumer is unsubscribed. +Will be available soon + +Will be available soon + +Will be available soon + @@ -819,6 +935,8 @@ consumer.unsubscribe().await; +Will be available soon + +Will be available soon + +Will be available soon + @@ -876,4 +1001,4 @@ SHOW TOPICS; ```sql SHOW CONSUMERS; -``` \ No newline at end of file +``` diff --git a/docs/examples/rust/cloud-example/examples/subscribe_demo.rs b/docs/examples/rust/cloud-example/examples/subscribe_demo.rs index 5b20cabe2fc91716b525dc4d1d4851a9cc75a540..ec4b62e5526f65052fdba31bbbc7a3780d61aab1 100644 --- a/docs/examples/rust/cloud-example/examples/subscribe_demo.rs +++ b/docs/examples/rust/cloud-example/examples/subscribe_demo.rs @@ -35,7 +35,7 @@ async fn prepare(taos: Taos) -> anyhow::Result<()> { #[tokio::main] 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 taos = builder.build()?;