You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shenyu.apache.org by li...@apache.org on 2022/12/07 02:15:48 UTC

[shenyu-website] branch main updated: [doc: tars plugin] update the documentation of the tars plugin (#832)

This is an automated email from the ASF dual-hosted git repository.

likeguo pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/shenyu-website.git


The following commit(s) were added to refs/heads/main by this push:
     new a228f730e6d [doc: tars plugin] update the documentation of the tars plugin (#832)
a228f730e6d is described below

commit a228f730e6dce56ba3617741305239116486e8b8
Author: lahmxu <la...@gmail.com>
AuthorDate: Wed Dec 7 10:15:42 2022 +0800

    [doc: tars plugin] update the documentation of the tars plugin (#832)
---
 docs/plugin-center/proxy/tars-plugin.md            | 195 ++++++++++++--------
 .../current/plugin-center/proxy/tars-plugin.md     | 194 ++++++++++++--------
 .../plugin-center/proxy/tars-plugin.md             | 195 ++++++++++++--------
 static/img/shenyu/plugin/tars/check_request_zh.png | Bin 0 -> 429938 bytes
 static/img/shenyu/plugin/tars/close_tars_en.png    | Bin 0 -> 121714 bytes
 static/img/shenyu/plugin/tars/close_tars_zh.png    | Bin 0 -> 137920 bytes
 static/img/shenyu/plugin/tars/enable_tars_en.png   | Bin 0 -> 120969 bytes
 static/img/shenyu/plugin/tars/enable_tars_zh.png   | Bin 0 -> 121334 bytes
 static/img/shenyu/plugin/tars/img.png              | Bin 0 -> 14772 bytes
 .../img/shenyu/plugin/tars/metadata_config_en.png  | Bin 0 -> 157836 bytes
 .../img/shenyu/plugin/tars/metadata_config_zh.png  | Bin 0 -> 187057 bytes
 static/img/shenyu/plugin/tars/plugin_config_en.png | Bin 0 -> 120589 bytes
 static/img/shenyu/plugin/tars/plugin_config_zh.png | Bin 0 -> 120426 bytes
 static/img/shenyu/plugin/tars/produce_chart_en.png | Bin 0 -> 21953 bytes
 static/img/shenyu/plugin/tars/produce_chart_zh.png | Bin 0 -> 20280 bytes
 static/img/shenyu/plugin/tars/rule_config_en.png   | Bin 0 -> 148169 bytes
 static/img/shenyu/plugin/tars/rule_config_zh.png   | Bin 0 -> 167628 bytes
 .../img/shenyu/plugin/tars/selector_config_en.png  | Bin 0 -> 144182 bytes
 .../img/shenyu/plugin/tars/selector_config_zh.png  | Bin 0 -> 167726 bytes
 .../plugin-center/proxy/tars-plugin.md             | 196 +++++++++++++--------
 20 files changed, 494 insertions(+), 286 deletions(-)

diff --git a/docs/plugin-center/proxy/tars-plugin.md b/docs/plugin-center/proxy/tars-plugin.md
index 4020ca80b73..fd9c3628b02 100644
--- a/docs/plugin-center/proxy/tars-plugin.md
+++ b/docs/plugin-center/proxy/tars-plugin.md
@@ -1,121 +1,170 @@
 ---
-title: Tars Plugin
-keywords: ["tars-plugin"]
-description:  tars-plugin
+title: Tars Plugin   
+keywords: ["Tars"]
+description: Tars Plugin
 ---
 
+# 1. Overview
 
-## Description
+## 1.1 Plugin name
 
-* The tars plugin is a plugin that converts the Http protocol into the tars protocol.
+- Tars plugin
 
+## 1.2 Appropriate scenario
 
-## Plugin Setting
+- Protocol conversion, a plugin that converts http protocol requests into the Tars framework protocol
+- Service Load Balancing.
 
-* Add related dependencies and enable plugin, please refer to: [Quick start with Tars](../../quick-start/quick-start-tars) .
+## 1.3 Plugin functionality
 
-* `Tars` client access, please refer to: [Tars Proxy](../../user-guide/tars-proxy) .
+- Converting http protocol requests to Tars framework protocol.
 
+## 1.4 Plugin code
 
+- Core Module `shenyu-plugin-tars`
+- Core Class `org.apache.shenyu.plugin.tars.TarsPlugin`
 
-## Plugin Detail
+## 1.5 Added since which shenyu version
 
-After the client accesses the `Apache ShenYu` gateway, it will automatically register the selector and rule information. You can see it in PluginList -> rpc proxy -> tars. For details about the selector and rule configuration, see [Selector And Rule Config](../../user-guide/admin-usage/selector-and-rule) .
+- 2.3.0
 
+# 2. How to use plugin
 
+## 2.1 Plugin-use procedure chart
 
-#### Selector Handler
+![image-20221206221707914](/img/shenyu/plugin/tars/produce_chart_en.png)
 
-<img src="/img/shenyu/plugin/tars/selector_en.png" width="80%" height="80%" />
+## 2.2 Import pom
 
+```xml
+        <dependency>
+            <groupId>org.apache.shenyu</groupId>
+            <artifactId>shenyu-spring-boot-starter-client-tars</artifactId>
+            <version>${shenyu.version}</version>
+        </dependency>
+```
 
-Selector Handler, the `handle` field is the tars service that is actually invoked after the gateway matches the traffic. You can configure multiple load balancing weights and specify the specific load balancing policy in the rules. For more information, see [Plugin Handle Management](../../user-guide/admin-usage/plugin-handle-explanation) .
+## 2.3 Configure in the client project
+
+1. Configure the Tars configuration in application.yml.
+
+```yaml
+shenyu:
+  register:
+    registerType: http #zookeeper #etcd #nacos #consul
+    serverLists: http://localhost:9095 #localhost:2181 #http://localhost:2379 #localhost:8848
+    props:
+      username: admin
+      password: 123456
+  client:
+    tars:
+      props:
+        contextPath: /tars
+        appName: tars
+        port: 21715
+        host: 192.168.41.103 # client IP
+```
 
+2. Add the `@ShenyuTarsService` and `@ShenyuTarsClient` and  annotation to the interface.
+
+```java
+@TarsServant("HelloObj")
+@ShenyuTarsService(serviceName = "ShenyuExampleServer.ShenyuExampleApp.HelloObj")
+public class HelloServantImpl implements HelloServant {
+  
+    @Override
+    @ShenyuTarsClient("/hello")
+    public String hello(final int no, final String name) {
+        return String.format("hello no=%s, name=%s, time=%s", no, name, System.currentTimeMillis());
+    }
+}
+```
 
-* config details:
 
-  * `host`:generally, enter `localhost`.
+## 2.4 Enable plugin
 
-  * `ip:port`:enter the ip:port of your real service .
+- In shenyu-admin --> BasicConfig --> Plugin --> `tars` set Status enabled.
 
-  * `protocol`:indicates the Http protocol. Generally, the value is `http://` or `https://`. If the value is not specified, the default value is `http://` .
+![enable_tars_en](/img/shenyu/plugin/tars/enable_tars_en.png)
 
-  * `startupTime`: start up time.
 
-  * `weight`: load balancing weight.
+## 2.5 Config plugin
 
-  * `warmupTime`:warm up time.
+### 2.5.1 Config plugin
 
-  * `status`:open or close.
+![plugin_config_en](/img/shenyu/plugin/tars/plugin_config_en.png)
 
+- `multiSelectorHandle`:Set to enable multiple selector processing, multiple selector processing services can be configured in the selector list.
+- `multiRuleHandle`:Set to multiple rules processing, configure multiple processing rules in the rule list, it is recommended to configure as single rule.
+- `threadpool`:There are five types of business thread pools: `fixed`, `eager`, `cached`, `limited` and `shared`. The first 4 types correspond to the thread pools officially provided by dubbo. Let's talk about `shared`, as its name implies, `all proxy plugins` share a `shared` thread pool, the advantage of this is that it can reduce the number of thread pools, thereby reducing memory and improving resource utilization.
+- `corethreads`:The number of core threads in the business thread pool.
+- `threads`:The maximum number of threads in the business thread pool.
+- `queues`:The length of the blocking queue of the business thread pool, 0 means `unbounded blocking queue`.
 
-#### Rule Handle
+### 2.5.2 Selector config
 
-<img src="/img/shenyu/plugin/tars/rule_en.png" width="80%" height="80%" />
+> Flow needs to be matched by selector.
 
-Rule Handle, the `handle` field indicates the processing rule adopted by the gateway after the final matching of traffic. For more information, see [Plugin Handle Management](../../user-guide/admin-usage/plugin-handle-explanation) .
+![selector_config_en](/img/shenyu/plugin/tars/selector_config_en.png)
 
-* config details:
-  * `loadStrategy`: if the `Http` client is a cluster, Apache ShenYu gateway uses the load balancing policy when calling, currently supporting `roundRobin`, `random`, and `hash`.
-  * `retryCount`: the number of retries to invoke the client.
-  * `timeout`: time out to invoke the client.
+Automatically configure the selectors with the `@ShenyuTarsClient` annotation.
 
-## Metadata
+### 2.5.3 Rule Config
 
+> After the traffic has been successfully matched by the selector, it will enter the rules for the final traffic matching.
 
-Each `tars` interface method, will correspond to a metadata, when the `tars` application client access to the `Apache ShenYu` gateway, will be automatically registered, can be viewed in the `shenyu-admin` background management system of the BasicConfig --> Metadata management.
+![rule_config_en](/img/shenyu/plugin/tars/rule_config_en.png)
 
-<img src="/img/shenyu/plugin/tars/metadata_en.png" width="80%" height="80%" />
+Automatically configure the rules with the `@ShenyuTarsClient` annotation.
 
+### 2.5.4 Metadata config
 
-* AppName: specifies the name of the application to which the metadata belongs.
+> When the `Tars` application client accesses the `Apache ShenYu` gateway, it will be automatically registered, and can be viewed in the `shenyu-admin` backend management system's basic configuration `-->` metadata management, each `Tars` interface method, will correspond to a metadata.
 
-* MethodName: the name of the method to call.
+![metadata_config_en](/img/shenyu/plugin/tars/metadata_config_en.png)
 
-* Path: http request path.
+- AppName: specifies the name of the application to which the metadata belongs.
 
-* PathDescribe: the description of the path is easy to view.
+- MethodName: the name of the method to call.
 
-* ParamsType: the parameters are separated by commas (,) in the order of interface parameter types.
+- Path: http request path.
 
-* RpcExpand: describes each interface in a `tars` service. For example, here are the two interfaces for the `tars` service:
+- PathDescribe: the description of the path is easy to view.
 
-```json
-{
-  "methodInfo": [
-    {
-      "methodName": "helloInt",
-      "params": [
-        {
-          "left": "int",
-          "right": "no"
-        },
-        {
-          "left": "java.lang.String",
-          "right": "name"
-        }
-      ],
-      "returnType": "int"
-    },
-    {
-      "methodName": "hello",
-      "params": [
-        {
-          "left": "int",
-          "right": "no"
-        },
-        {
-          "left": "java.lang.String",
-          "right": "name"
-        }
-      ],
-      "returnType": "java.lang.String"
-    }
-  ]
-}
-```
+- ParamsType: the parameters are separated by commas (,) in the order of interface parameter types.
+
+- RpcExpand: other configurations of the `Tars` interface, which support the `JSON` format.
+
+  examples:`{"loadbalance":"hash","retries":3,"timeout":-1}`
+
+  - `loadbalance`:Load balancing policy, currently supports roundRobin, random and hash.
+  - `retries`:Number of retries to call client timeout failures.
+  - `timeout`:Calling the client's timeout time.
+
+- Interface: The fully qualified class name of the `Tars` interface.
+
+- RpcType:Auto-registration defaults to `Tars`.
+
+## 2.6 Examples
+
+### 2.6.1 Using ShenYu to access the Tars service
+
+#### 2.6.1.1 Preparation
+
+- Start `ShenYu Admin`.
+- Start `Shenyu Bootstrap`.
+
+#### 2.6.1.2 Plugin Config
+
+- In shenyu-admin --> BasicConfig --> Plugin --> `tars` set Status enabled, And adjust the registry configuration as needed.
+- Adjust to the actual situation [shenyu-examples-tars](https://github.com/apache/shenyu/tree/master/shenyu-examples/shenyu-examples-tars) application.yml configuration in the project and start it.
+
+#### 2.6.2.6 Request service and check result
+
+![check_request_zh](/img/shenyu/plugin/tars/check_request_zh.png)
 
+# 3. How to disable plugin
 
-* Interface: The `serviceName` specified in the `@ShenyuTarsService` annotation.
+- In `shenyu-admin` --> BasicConfig --> Plugin --> `tars` set Status disable.
 
-* RpcType:choose `tars`.
+![close_tars_en](/img/shenyu/plugin/tars/close_tars_en.png)
diff --git a/i18n/zh/docusaurus-plugin-content-docs/current/plugin-center/proxy/tars-plugin.md b/i18n/zh/docusaurus-plugin-content-docs/current/plugin-center/proxy/tars-plugin.md
index be267eb8e8e..c74621589ee 100644
--- a/i18n/zh/docusaurus-plugin-content-docs/current/plugin-center/proxy/tars-plugin.md
+++ b/i18n/zh/docusaurus-plugin-content-docs/current/plugin-center/proxy/tars-plugin.md
@@ -4,112 +4,166 @@ keywords: ["Tars"]
 description:  Tars插件
 ---
 
+# 1. 概述
 
-## 说明
+## 1.1 插件名称
 
-`Tars`插件是网关用于处理 `Tars协议`请求的核心处理插件。
+- Tars插件
 
-## 插件设置
+## 1.2 适用场景
 
-* 引入相关依赖,开启插件,请参考:[Tars快速开始](../../quick-start/quick-start-tars) 。
+- 协议转换,将 http 协议的请求转换成 Tars 框架协议的服务处理的插件
+- 服务负载均衡
 
-* `Tars`应用客户端接入,请参考:[Tars服务接入](../../user-guide/tars-proxy) 。
+## 1.3 插件功能
 
+- 将 http 协议的请求转换成 Tars 框架协议
 
-## 插件讲解
+## 1.4 插件代码
 
-客户端接入`Apache ShenYu`网关后,会自动注册选择器和规则信息,可以在插件列表 `->` rpc proxy `->` tars 中查看。关于选择器和规则配置,请参考:[选择器和规则管理](../../user-guide/admin-usage/selector-and-rule)。
+- 核心模块`shenyu-plugin-tars`
+- 核心类`org.apache.shenyu.plugin.tars.TarsPlugin`
 
+## 1.5 添加自哪个shenyu版本
 
+- 2.3.0
 
-#### 选择器处理
+# 2. 如何使用插件
 
-<img src="/img/shenyu/plugin/tars/selector_zh.png" width="80%" height="80%" />
+## 2.1 插件使用流程图
 
+![produce_chart_zh](/img/shenyu/plugin/tars/produce_chart_zh.png)
 
-选择器处理,即`handle`字段,是网关匹配到流量以后,实际调用的`tars`服务,可以配置多个,设置负载均衡权重,具体的负载均衡策略,在规则中指定。更多信息请参考插件管理中的 [插件处理管理](../../user-guide/admin-usage/plugin-handle-explanation) 。
+## 2.2 导入pom
 
-* 处理配置详解:
+```xml
+        <dependency>
+            <groupId>org.apache.shenyu</groupId>
+            <artifactId>shenyu-spring-boot-starter-client-tars</artifactId>
+            <version>${shenyu.version}</version>
+        </dependency>
+```
 
-  * `host`:一般填写 `localhost`。
+## 2.3 在客户端项目中配置
+
+1. 在 application.yml 中配置 Tars 的配置
+
+```yaml
+shenyu:
+  register:
+    registerType: http #zookeeper #etcd #nacos #consul
+    serverLists: http://localhost:9095 #localhost:2181 #http://localhost:2379 #localhost:8848
+    props:
+      username: admin
+      password: 123456
+  client:
+    tars:
+      props:
+        contextPath: /tars
+        appName: tars
+        port: 21715
+        host: 192.168.41.103 # client IP
+```
 
-  * `ip:port`:`ip` 与端口,这里填写你真实服务的 `ip` + 端口。
+2. 在接口上添加`@ShenyuTarsService`和`@ShenyuTarsClient`注解
+
+```java
+@TarsServant("HelloObj")
+@ShenyuTarsService(serviceName = "ShenyuExampleServer.ShenyuExampleApp.HelloObj")
+public class HelloServantImpl implements HelloServant {
+  
+    @Override
+    @ShenyuTarsClient("/hello")
+    public String hello(final int no, final String name) {
+        return String.format("hello no=%s, name=%s, time=%s", no, name, System.currentTimeMillis());
+    }
+}
+```
 
-  * `protocol`::`http` 协议,一般填写 `http://` 或者 `https://` ,不填写默认为:`http://`
 
-  * `startupTime`: 启用时间。
 
-  * `weight`:负载均衡权重。
+## 2.4 启用插件
 
-  * `warmupTime`:预热时间。
+- 在 `shenyu-admin` --> 基础配置 --> 插件管理-> `tars` ,设置为开启。
 
-  * `status`:开启或关闭。
+![enable_tars_zh](/img/shenyu/plugin/tars/enable_tars_zh.png)
 
+## 2.5 配置插件
 
-#### 规则处理
+### 2.5.1 配置插件
 
-<img src="/img/shenyu/plugin/tars/rule_zh.png" width="80%" height="80%" />
+![plugin_config_zh](/img/shenyu/plugin/tars/plugin_config_zh.png)
 
-规则处理,即`handle`字段,是网关对流量完成最终匹配后,采取何种处理规则。更多信息请参考插件管理中的 [插件处理管理](../../user-guide/admin-usage/plugin-handle-explanation) 。
+- `multiSelectorHandle`:设置为可以多个选择器处理,在选择器列表可配置多个选择器处理服务。
+- `multiRuleHandle`:设置为可以多个规则处理,在规则列表配置多个处理规则,建议配置为 single rule。
+- `threadpool`:业务线程池类型,有`fixed`、`eager`、`cached`、`limited`和`shared`共5种类型,前面4种与dubbo官方提供的线程池一一对应,不多解释,这里单独说下`shared`,正如其名,`所有proxy插件`共用一个`shared`线程池,这样做的好处是能够减少线程池数量,进而降低内存、提高资源利用率。
+- `corethreads`:业务线程池核心线程数。
+- `threads`:业务线程池最大线程数。
+- `queues`:业务线程池阻塞队列长度,0表示`无界阻塞队列`。
 
-* 处理配置详解:
-  * `loadStrategy`:如果`http`客户端是一个集群,`Apache ShenYu`网关调用时采取哪种负载均衡策略,当前支持 `roundRobin`、`random`和`hash`。
-  * `retryCount`:调用`http`客户端的重试次数。
-  * `timeout`:调用`http`客户端的超时时间。
+### 2.5.2 选择器配置
 
-## 元数据
+> 流量需要经过选择器匹配。
 
-每一个`tars`接口方法,都会对应一条元数据,当`tars`应用客户端接入到`Apache ShenYu`网关时,会自动注册,可以在 `shenyu-admin`后台管理系统的基础配置 `-->` 元数据管理中查看。
+![selector_config_zh](/img/shenyu/plugin/tars/selector_config_zh.png)
 
-<img src="/img/shenyu/plugin/tars/metadata_zh.png" width="80%" height="80%" />
+- 通过`@ShenyuTarsClient`注解自动配置选择器。
 
-* 应用名称:该条元数据所属的应用名称。
+### 2.5.3 规则配置
 
-* 方法名称:需要调用的方法名。
+> 流量经过选择器匹配成功之后,会进入规则来进行最终的流量匹配。
 
-* 路径:`tars`请求路径。
+![rule_config_zh](/img/shenyu/plugin/tars/rule_config_zh.png)
 
-* 路径描述:对该路径的说明,方便查看。
+- 通过`@ShenyuTarsClient`注解自动配置规则。
 
-* 参数类型:`tars`接口的参数类型列表,按照接口的参数类型顺序,通过半角逗号分隔。
+### 2.5.4 元数据配置
 
-* Rpc扩展参数:描述了一个`tars`服务中每个接口信息。比如,下面是`tars`服务的两个接口信息:
+> 当`Tars` 应用客户端接入到`Apache ShenYu`网关时,会自动注册,可以在 `shenyu-admin`后台管理系统的基础配置 `-->` 元数据管理中查看,每一个`Tars`接口方法,都会对应一条元数据。
 
-```json
-{
-  "methodInfo": [
-    {
-      "methodName": "helloInt",
-      "params": [
-        {
-          "left": "int",
-          "right": "no"
-        },
-        {
-          "left": "java.lang.String",
-          "right": "name"
-        }
-      ],
-      "returnType": "int"
-    },
-    {
-      "methodName": "hello",
-      "params": [
-        {
-          "left": "int",
-          "right": "no"
-        },
-        {
-          "left": "java.lang.String",
-          "right": "name"
-        }
-      ],
-      "returnType": "java.lang.String"
-    }
-  ]
-}
-```
+![metadata_config_zh](/img/shenyu/plugin/tars/metadata_config_zh.png)
+
+- 应用名称:该条元数据所属的应用名称。
+
+- 方法名称:需要调用的方法名。
+
+- 路径:`http`请路径。
+
+- 路径描述:对该路径的说明,方便查看。
+
+- 参数类型:按照接口的参数类型顺序。
+
+- Rpc扩展参数:接口的扩展参数配置,`json`格式。
+
+  示例:`{"loadbalance":"hash","retries":3,"timeout":-1}`
+
+  - `loadbalance`:负载均衡策略,当前支持 roundRobin、random 和 hash。
+  - `retries`:调用客户端超时失败的重试次数。
+  - `timeout`:调用客户端的超时时间。
+
+- 服务接口:`Tars`接口的全限定类名。
+- `Rpc`类型:自动注册默认为 `tars`。
+
+## 2.6 示例
+
+### 2.6.1 使用 ShenYu 访问 Tars 服务
+
+#### 2.6.1.1 准备工作
+
+- 启动 `ShenYu Admin`。
+- 启动 `Shenyu Bootstrap`。
+
+#### 2.6.1.2 插件配置
+
+- 打开插件,在 `shenyu-admin` --> 基础配置 --> 插件管理-> `tars` ,设置为开启。
+- 根据实际情况调整 [shenyu-examples-tars](https://github.com/apache/shenyu/tree/master/shenyu-examples/shenyu-examples-tars) 项目中 application.yml 和 ShenyuExampleServer.ShenyuExampleApp.config.conf 文件并启动。
+
+#### 2.6.2.6 请求服务并且验证结果
+
+![check_request_zh](/img/shenyu/plugin/tars/check_request_zh.png)
+
+# 3. 如何禁用插件
 
-* 服务接口:在注解 `@ShenyuTarsService` 中指定的`serviceName` 。
+- 在 shenyu-admin --> 基础配置 --> 插件管理 --> 关闭 Tars 插件状态
 
-* `Rpc`类型:下拉选择 `tars`。
+![close_tars_zh](/img/shenyu/plugin/tars/close_tars_zh.png)
diff --git a/i18n/zh/docusaurus-plugin-content-docs/version-2.5.0/plugin-center/proxy/tars-plugin.md b/i18n/zh/docusaurus-plugin-content-docs/version-2.5.0/plugin-center/proxy/tars-plugin.md
index be267eb8e8e..f497d052d14 100644
--- a/i18n/zh/docusaurus-plugin-content-docs/version-2.5.0/plugin-center/proxy/tars-plugin.md
+++ b/i18n/zh/docusaurus-plugin-content-docs/version-2.5.0/plugin-center/proxy/tars-plugin.md
@@ -4,112 +4,167 @@ keywords: ["Tars"]
 description:  Tars插件
 ---
 
+# 1. 概述
 
-## 说明
+## 1.1 插件名称
 
-`Tars`插件是网关用于处理 `Tars协议`请求的核心处理插件。
+- Tars插件
 
-## 插件设置
+## 1.2 适用场景
 
-* 引入相关依赖,开启插件,请参考:[Tars快速开始](../../quick-start/quick-start-tars) 。
+- 协议转换,将 http 协议的请求转换成 Tars 框架协议的服务处理的插件
+- 服务负载均衡
 
-* `Tars`应用客户端接入,请参考:[Tars服务接入](../../user-guide/tars-proxy) 。
+## 1.3 插件功能
 
+- 将 http 协议的请求转换成 Tars 框架协议
 
-## 插件讲解
+## 1.4 插件代码
 
-客户端接入`Apache ShenYu`网关后,会自动注册选择器和规则信息,可以在插件列表 `->` rpc proxy `->` tars 中查看。关于选择器和规则配置,请参考:[选择器和规则管理](../../user-guide/admin-usage/selector-and-rule)。
+- 核心模块`shenyu-plugin-tars`
+- 核心类`org.apache.shenyu.plugin.tars.TarsPlugin`
 
+## 1.5 添加自哪个shenyu版本
 
+- 2.3.0
 
-#### 选择器处理
+# 2. 如何使用插件
 
-<img src="/img/shenyu/plugin/tars/selector_zh.png" width="80%" height="80%" />
+## 2.1 插件使用流程图
 
+![produce_chart_zh](/img/shenyu/plugin/tars/produce_chart_zh.png)
 
-选择器处理,即`handle`字段,是网关匹配到流量以后,实际调用的`tars`服务,可以配置多个,设置负载均衡权重,具体的负载均衡策略,在规则中指定。更多信息请参考插件管理中的 [插件处理管理](../../user-guide/admin-usage/plugin-handle-explanation) 。
+## 2.2 导入pom
 
-* 处理配置详解:
+```xml
+        <dependency>
+  <groupId>org.apache.shenyu</groupId>
+  <artifactId>shenyu-spring-boot-starter-client-tars</artifactId>
+  <version>${shenyu.version}</version>
+</dependency>
+```
 
-  * `host`:一般填写 `localhost`。
+## 2.3 在客户端项目中配置
+
+1. 在 application.yml 中配置 Tars 的配置
+
+```yaml
+shenyu:
+  register:
+    registerType: http #zookeeper #etcd #nacos #consul
+    serverLists: http://localhost:9095 #localhost:2181 #http://localhost:2379 #localhost:8848
+    props:
+      username: admin
+      password: 123456
+  client:
+    tars:
+      props:
+        contextPath: /tars
+        appName: tars
+        port: 21715
+        host: 192.168.41.103 # client IP
+```
 
-  * `ip:port`:`ip` 与端口,这里填写你真实服务的 `ip` + 端口。
+2. 在接口上添加`@ShenyuTarsService`和`@ShenyuTarsClient`注解
+
+```java
+@TarsServant("HelloObj")
+@ShenyuTarsService(serviceName = "ShenyuExampleServer.ShenyuExampleApp.HelloObj")
+public class HelloServantImpl implements HelloServant {
+  
+    @Override
+    @ShenyuTarsClient("/hello")
+    public String hello(final int no, final String name) {
+        return String.format("hello no=%s, name=%s, time=%s", no, name, System.currentTimeMillis());
+    }
+}
+```
 
-  * `protocol`::`http` 协议,一般填写 `http://` 或者 `https://` ,不填写默认为:`http://`
 
-  * `startupTime`: 启用时间。
 
-  * `weight`:负载均衡权重。
+## 2.4 启用插件
 
-  * `warmupTime`:预热时间。
+- 在 `shenyu-admin` --> 基础配置 --> 插件管理-> `tars` ,设置为开启。
 
-  * `status`:开启或关闭。
+![enable_tars_zh](/img/shenyu/plugin/tars/enable_tars_zh.png)
 
 
-#### 规则处理
+## 2.5 配置插件
 
-<img src="/img/shenyu/plugin/tars/rule_zh.png" width="80%" height="80%" />
+### 2.5.1 配置插件
 
-规则处理,即`handle`字段,是网关对流量完成最终匹配后,采取何种处理规则。更多信息请参考插件管理中的 [插件处理管理](../../user-guide/admin-usage/plugin-handle-explanation) 。
+![plugin_config_zh](/img/shenyu/plugin/tars/plugin_config_zh.png)
 
-* 处理配置详解:
-  * `loadStrategy`:如果`http`客户端是一个集群,`Apache ShenYu`网关调用时采取哪种负载均衡策略,当前支持 `roundRobin`、`random`和`hash`。
-  * `retryCount`:调用`http`客户端的重试次数。
-  * `timeout`:调用`http`客户端的超时时间。
+- `multiSelectorHandle`:设置为可以多个选择器处理,在选择器列表可配置多个选择器处理服务。
+- `multiRuleHandle`:设置为可以多个规则处理,在规则列表配置多个处理规则,建议配置为 single rule。
+- `threadpool`:业务线程池类型,有`fixed`、`eager`、`cached`、`limited`和`shared`共5种类型,前面4种与dubbo官方提供的线程池一一对应,不多解释,这里单独说下`shared`,正如其名,`所有proxy插件`共用一个`shared`线程池,这样做的好处是能够减少线程池数量,进而降低内存、提高资源利用率。
+- `corethreads`:业务线程池核心线程数。
+- `threads`:业务线程池最大线程数。
+- `queues`:业务线程池阻塞队列长度,0表示`无界阻塞队列`。
 
-## 元数据
+### 2.5.2 选择器配置
 
-每一个`tars`接口方法,都会对应一条元数据,当`tars`应用客户端接入到`Apache ShenYu`网关时,会自动注册,可以在 `shenyu-admin`后台管理系统的基础配置 `-->` 元数据管理中查看。
+> 流量需要经过选择器匹配。
 
-<img src="/img/shenyu/plugin/tars/metadata_zh.png" width="80%" height="80%" />
+![selector_config_zh](/img/shenyu/plugin/tars/selector_config_zh.png)
 
-* 应用名称:该条元数据所属的应用名称。
+- 通过`@ShenyuTarsClient`注解自动配置选择器。
 
-* 方法名称:需要调用的方法名。
+### 2.5.3 规则配置
 
-* 路径:`tars`请求路径。
+> 流量经过选择器匹配成功之后,会进入规则来进行最终的流量匹配。
 
-* 路径描述:对该路径的说明,方便查看。
+![rule_config_zh](/img/shenyu/plugin/tars/rule_config_zh.png)
 
-* 参数类型:`tars`接口的参数类型列表,按照接口的参数类型顺序,通过半角逗号分隔。
+- 通过`@ShenyuTarsClient`注解自动配置规则。
 
-* Rpc扩展参数:描述了一个`tars`服务中每个接口信息。比如,下面是`tars`服务的两个接口信息:
+### 2.5.4 元数据配置
 
-```json
-{
-  "methodInfo": [
-    {
-      "methodName": "helloInt",
-      "params": [
-        {
-          "left": "int",
-          "right": "no"
-        },
-        {
-          "left": "java.lang.String",
-          "right": "name"
-        }
-      ],
-      "returnType": "int"
-    },
-    {
-      "methodName": "hello",
-      "params": [
-        {
-          "left": "int",
-          "right": "no"
-        },
-        {
-          "left": "java.lang.String",
-          "right": "name"
-        }
-      ],
-      "returnType": "java.lang.String"
-    }
-  ]
-}
-```
+> 当`Tars` 应用客户端接入到`Apache ShenYu`网关时,会自动注册,可以在 `shenyu-admin`后台管理系统的基础配置 `-->` 元数据管理中查看,每一个`Tars`接口方法,都会对应一条元数据。
+
+![metadata_config_zh](/img/shenyu/plugin/tars/metadata_config_zh.png)
+
+- 应用名称:该条元数据所属的应用名称。
+
+- 方法名称:需要调用的方法名。
+
+- 路径:`http`请路径。
+
+- 路径描述:对该路径的说明,方便查看。
+
+- 参数类型:按照接口的参数类型顺序。
+
+- Rpc扩展参数:接口的扩展参数配置,`json`格式。
+
+  示例:`{"loadbalance":"hash","retries":3,"timeout":-1}`
+
+  - `loadbalance`:负载均衡策略,当前支持 roundRobin、random 和 hash。
+  - `retries`:调用客户端超时失败的重试次数。
+  - `timeout`:调用客户端的超时时间。
+
+- 服务接口:`Tars`接口的全限定类名。
+- `Rpc`类型:自动注册默认为 `tars`。
+
+## 2.6 示例
+
+### 2.6.1 使用 ShenYu 访问 Tars 服务
+
+#### 2.6.1.1 准备工作
+
+- 启动 `ShenYu Admin`。
+- 启动 `Shenyu Bootstrap`。
+
+#### 2.6.1.2 插件配置
+
+- 打开插件,在 `shenyu-admin` --> 基础配置 --> 插件管理-> `tars` ,设置为开启。
+- 根据实际情况调整 [shenyu-examples-tars](https://github.com/apache/shenyu/tree/master/shenyu-examples/shenyu-examples-tars) 项目中 application.yml 和 ShenyuExampleServer.ShenyuExampleApp.config.conf 文件并启动。
+
+#### 2.6.2.6 请求服务并且验证结果
+
+![check_request_zh](/img/shenyu/plugin/tars/check_request_zh.png)
+
+# 3. 如何禁用插件
 
-* 服务接口:在注解 `@ShenyuTarsService` 中指定的`serviceName` 。
+- 在 shenyu-admin --> 基础配置 --> 插件管理 --> 关闭 Tars 插件状态
 
-* `Rpc`类型:下拉选择 `tars`。
+![close_tars_zh](/img/shenyu/plugin/tars/close_tars_zh.png)
diff --git a/static/img/shenyu/plugin/tars/check_request_zh.png b/static/img/shenyu/plugin/tars/check_request_zh.png
new file mode 100644
index 00000000000..58c84ae9d6d
Binary files /dev/null and b/static/img/shenyu/plugin/tars/check_request_zh.png differ
diff --git a/static/img/shenyu/plugin/tars/close_tars_en.png b/static/img/shenyu/plugin/tars/close_tars_en.png
new file mode 100644
index 00000000000..85c3a13fb84
Binary files /dev/null and b/static/img/shenyu/plugin/tars/close_tars_en.png differ
diff --git a/static/img/shenyu/plugin/tars/close_tars_zh.png b/static/img/shenyu/plugin/tars/close_tars_zh.png
new file mode 100644
index 00000000000..6f5db050139
Binary files /dev/null and b/static/img/shenyu/plugin/tars/close_tars_zh.png differ
diff --git a/static/img/shenyu/plugin/tars/enable_tars_en.png b/static/img/shenyu/plugin/tars/enable_tars_en.png
new file mode 100644
index 00000000000..824b8e2fd05
Binary files /dev/null and b/static/img/shenyu/plugin/tars/enable_tars_en.png differ
diff --git a/static/img/shenyu/plugin/tars/enable_tars_zh.png b/static/img/shenyu/plugin/tars/enable_tars_zh.png
new file mode 100644
index 00000000000..af39b139074
Binary files /dev/null and b/static/img/shenyu/plugin/tars/enable_tars_zh.png differ
diff --git a/static/img/shenyu/plugin/tars/img.png b/static/img/shenyu/plugin/tars/img.png
new file mode 100644
index 00000000000..ee3c5fdbc23
Binary files /dev/null and b/static/img/shenyu/plugin/tars/img.png differ
diff --git a/static/img/shenyu/plugin/tars/metadata_config_en.png b/static/img/shenyu/plugin/tars/metadata_config_en.png
new file mode 100644
index 00000000000..cc1fda1be4f
Binary files /dev/null and b/static/img/shenyu/plugin/tars/metadata_config_en.png differ
diff --git a/static/img/shenyu/plugin/tars/metadata_config_zh.png b/static/img/shenyu/plugin/tars/metadata_config_zh.png
new file mode 100644
index 00000000000..a7f8e7d8727
Binary files /dev/null and b/static/img/shenyu/plugin/tars/metadata_config_zh.png differ
diff --git a/static/img/shenyu/plugin/tars/plugin_config_en.png b/static/img/shenyu/plugin/tars/plugin_config_en.png
new file mode 100644
index 00000000000..d15bfa5b677
Binary files /dev/null and b/static/img/shenyu/plugin/tars/plugin_config_en.png differ
diff --git a/static/img/shenyu/plugin/tars/plugin_config_zh.png b/static/img/shenyu/plugin/tars/plugin_config_zh.png
new file mode 100644
index 00000000000..254d9caabe7
Binary files /dev/null and b/static/img/shenyu/plugin/tars/plugin_config_zh.png differ
diff --git a/static/img/shenyu/plugin/tars/produce_chart_en.png b/static/img/shenyu/plugin/tars/produce_chart_en.png
new file mode 100644
index 00000000000..7d8a5e5ab44
Binary files /dev/null and b/static/img/shenyu/plugin/tars/produce_chart_en.png differ
diff --git a/static/img/shenyu/plugin/tars/produce_chart_zh.png b/static/img/shenyu/plugin/tars/produce_chart_zh.png
new file mode 100644
index 00000000000..a1047804af2
Binary files /dev/null and b/static/img/shenyu/plugin/tars/produce_chart_zh.png differ
diff --git a/static/img/shenyu/plugin/tars/rule_config_en.png b/static/img/shenyu/plugin/tars/rule_config_en.png
new file mode 100644
index 00000000000..46c7ac12efe
Binary files /dev/null and b/static/img/shenyu/plugin/tars/rule_config_en.png differ
diff --git a/static/img/shenyu/plugin/tars/rule_config_zh.png b/static/img/shenyu/plugin/tars/rule_config_zh.png
new file mode 100644
index 00000000000..dbf7674b73e
Binary files /dev/null and b/static/img/shenyu/plugin/tars/rule_config_zh.png differ
diff --git a/static/img/shenyu/plugin/tars/selector_config_en.png b/static/img/shenyu/plugin/tars/selector_config_en.png
new file mode 100644
index 00000000000..fd7beaec469
Binary files /dev/null and b/static/img/shenyu/plugin/tars/selector_config_en.png differ
diff --git a/static/img/shenyu/plugin/tars/selector_config_zh.png b/static/img/shenyu/plugin/tars/selector_config_zh.png
new file mode 100644
index 00000000000..83993829de5
Binary files /dev/null and b/static/img/shenyu/plugin/tars/selector_config_zh.png differ
diff --git a/versioned_docs/version-2.5.0/plugin-center/proxy/tars-plugin.md b/versioned_docs/version-2.5.0/plugin-center/proxy/tars-plugin.md
index 4020ca80b73..3b431b90bd3 100644
--- a/versioned_docs/version-2.5.0/plugin-center/proxy/tars-plugin.md
+++ b/versioned_docs/version-2.5.0/plugin-center/proxy/tars-plugin.md
@@ -1,121 +1,171 @@
 ---
-title: Tars Plugin
-keywords: ["tars-plugin"]
-description:  tars-plugin
+title: Tars Plugin   
+keywords: ["Tars"]
+description: Tars Plugin
 ---
 
+# 1. Overview
 
-## Description
+## 1.1 Plugin name
 
-* The tars plugin is a plugin that converts the Http protocol into the tars protocol.
+- Tars plugin
 
+## 1.2 Appropriate scenario
 
-## Plugin Setting
+- Protocol conversion, a plugin that converts http protocol requests into the Tars framework protocol
+- Service Load Balancing.
 
-* Add related dependencies and enable plugin, please refer to: [Quick start with Tars](../../quick-start/quick-start-tars) .
+## 1.3 Plugin functionality
 
-* `Tars` client access, please refer to: [Tars Proxy](../../user-guide/tars-proxy) .
+- Converting http protocol requests to Tars framework protocol.
 
+## 1.4 Plugin code
 
+- Core Module `shenyu-plugin-tars`
+- Core Class `org.apache.shenyu.plugin.tars.TarsPlugin`
 
-## Plugin Detail
+## 1.5 Added since which shenyu version
 
-After the client accesses the `Apache ShenYu` gateway, it will automatically register the selector and rule information. You can see it in PluginList -> rpc proxy -> tars. For details about the selector and rule configuration, see [Selector And Rule Config](../../user-guide/admin-usage/selector-and-rule) .
+- 2.3.0
 
+# 2. How to use plugin
 
+## 2.1 Plugin-use procedure chart
 
-#### Selector Handler
+![image-20221206221707914](/img/shenyu/plugin/tars/produce_chart_en.png)
 
-<img src="/img/shenyu/plugin/tars/selector_en.png" width="80%" height="80%" />
+## 2.2 Import pom
 
+```xml
+        <dependency>
+            <groupId>org.apache.shenyu</groupId>
+            <artifactId>shenyu-spring-boot-starter-client-tars</artifactId>
+            <version>${shenyu.version}</version>
+        </dependency>
+```
 
-Selector Handler, the `handle` field is the tars service that is actually invoked after the gateway matches the traffic. You can configure multiple load balancing weights and specify the specific load balancing policy in the rules. For more information, see [Plugin Handle Management](../../user-guide/admin-usage/plugin-handle-explanation) .
+## 2.3 Configure in the client project
+
+1. Configure the Tars configuration in application.yml.
+
+```yaml
+shenyu:
+  register:
+    registerType: http #zookeeper #etcd #nacos #consul
+    serverLists: http://localhost:9095 #localhost:2181 #http://localhost:2379 #localhost:8848
+    props:
+      username: admin
+      password: 123456
+  client:
+    tars:
+      props:
+        contextPath: /tars
+        appName: tars
+        port: 21715
+        host: 192.168.41.103 # client IP
+```
 
+2. Add the `@ShenyuTarsService` and `@ShenyuTarsClient` and  annotation to the interface.
+
+```java
+@TarsServant("HelloObj")
+@ShenyuTarsService(serviceName = "ShenyuExampleServer.ShenyuExampleApp.HelloObj")
+public class HelloServantImpl implements HelloServant {
+  
+    @Override
+    @ShenyuTarsClient("/hello")
+    public String hello(final int no, final String name) {
+        return String.format("hello no=%s, name=%s, time=%s", no, name, System.currentTimeMillis());
+    }
+}
+```
 
-* config details:
 
-  * `host`:generally, enter `localhost`.
 
-  * `ip:port`:enter the ip:port of your real service .
+## 2.4 Enable plugin
 
-  * `protocol`:indicates the Http protocol. Generally, the value is `http://` or `https://`. If the value is not specified, the default value is `http://` .
+- In shenyu-admin --> BasicConfig --> Plugin --> `tars` set Status enabled.
 
-  * `startupTime`: start up time.
+![enable_tars_en](/img/shenyu/plugin/tars/enable_tars_en.png)
 
-  * `weight`: load balancing weight.
 
-  * `warmupTime`:warm up time.
+## 2.5 Config plugin
 
-  * `status`:open or close.
+### 2.5.1 Config plugin
 
+![plugin_config_en](/img/shenyu/plugin/tars/plugin_config_en.png)
 
-#### Rule Handle
+- `multiSelectorHandle`:Set to enable multiple selector processing, multiple selector processing services can be configured in the selector list.
+- `multiRuleHandle`:Set to multiple rules processing, configure multiple processing rules in the rule list, it is recommended to configure as single rule.
+- `threadpool`:There are five types of business thread pools: `fixed`, `eager`, `cached`, `limited` and `shared`. The first 4 types correspond to the thread pools officially provided by dubbo. Let's talk about `shared`, as its name implies, `all proxy plugins` share a `shared` thread pool, the advantage of this is that it can reduce the number of thread pools, thereby reducing memory and improving resource utilization.
+- `corethreads`:The number of core threads in the business thread pool.
+- `threads`:The maximum number of threads in the business thread pool.
+- `queues`:The length of the blocking queue of the business thread pool, 0 means `unbounded blocking queue`.
 
-<img src="/img/shenyu/plugin/tars/rule_en.png" width="80%" height="80%" />
+### 2.5.2 Selector config
 
-Rule Handle, the `handle` field indicates the processing rule adopted by the gateway after the final matching of traffic. For more information, see [Plugin Handle Management](../../user-guide/admin-usage/plugin-handle-explanation) .
+> Flow needs to be matched by selector.
 
-* config details:
-  * `loadStrategy`: if the `Http` client is a cluster, Apache ShenYu gateway uses the load balancing policy when calling, currently supporting `roundRobin`, `random`, and `hash`.
-  * `retryCount`: the number of retries to invoke the client.
-  * `timeout`: time out to invoke the client.
+![selector_config_en](/img/shenyu/plugin/tars/selector_config_en.png)
 
-## Metadata
+Automatically configure the selectors with the `@ShenyuTarsClient` annotation.
 
+### 2.5.3 Rule Config
 
-Each `tars` interface method, will correspond to a metadata, when the `tars` application client access to the `Apache ShenYu` gateway, will be automatically registered, can be viewed in the `shenyu-admin` background management system of the BasicConfig --> Metadata management.
+> After the traffic has been successfully matched by the selector, it will enter the rules for the final traffic matching.
 
-<img src="/img/shenyu/plugin/tars/metadata_en.png" width="80%" height="80%" />
+![rule_config_en](/img/shenyu/plugin/tars/rule_config_en.png)
 
+Automatically configure the rules with the `@ShenyuTarsClient` annotation.
 
-* AppName: specifies the name of the application to which the metadata belongs.
+### 2.5.4 Metadata config
 
-* MethodName: the name of the method to call.
+> When the `Tars` application client accesses the `Apache ShenYu` gateway, it will be automatically registered, and can be viewed in the `shenyu-admin` backend management system's basic configuration `-->` metadata management, each `Tars` interface method, will correspond to a metadata.
 
-* Path: http request path.
+![metadata_config_en](/img/shenyu/plugin/tars/metadata_config_en.png)
 
-* PathDescribe: the description of the path is easy to view.
+- AppName: specifies the name of the application to which the metadata belongs.
 
-* ParamsType: the parameters are separated by commas (,) in the order of interface parameter types.
+- MethodName: the name of the method to call.
 
-* RpcExpand: describes each interface in a `tars` service. For example, here are the two interfaces for the `tars` service:
+- Path: http request path.
 
-```json
-{
-  "methodInfo": [
-    {
-      "methodName": "helloInt",
-      "params": [
-        {
-          "left": "int",
-          "right": "no"
-        },
-        {
-          "left": "java.lang.String",
-          "right": "name"
-        }
-      ],
-      "returnType": "int"
-    },
-    {
-      "methodName": "hello",
-      "params": [
-        {
-          "left": "int",
-          "right": "no"
-        },
-        {
-          "left": "java.lang.String",
-          "right": "name"
-        }
-      ],
-      "returnType": "java.lang.String"
-    }
-  ]
-}
-```
+- PathDescribe: the description of the path is easy to view.
+
+- ParamsType: the parameters are separated by commas (,) in the order of interface parameter types.
+
+- RpcExpand: other configurations of the `Tars` interface, which support the `JSON` format.
+
+  examples:`{"loadbalance":"hash","retries":3,"timeout":-1}`
+
+  - `loadbalance`:Load balancing policy, currently supports roundRobin, random and hash.
+  - `retries`:Number of retries to call client timeout failures.
+  - `timeout`:Calling the client's timeout time.
+
+- Interface: The fully qualified class name of the `Tars` interface.
+
+- RpcType:Auto-registration defaults to `Tars`.
+
+## 2.6 Examples
+
+### 2.6.1 Using ShenYu to access the Tars service
+
+#### 2.6.1.1 Preparation
+
+- Start `ShenYu Admin`.
+- Start `Shenyu Bootstrap`.
+
+#### 2.6.1.2 Plugin Config
+
+- In shenyu-admin --> BasicConfig --> Plugin --> `tars` set Status enabled, And adjust the registry configuration as needed.
+- Adjust to the actual situation [shenyu-examples-tars](https://github.com/apache/shenyu/tree/master/shenyu-examples/shenyu-examples-tars) application.yml configuration in the project and start it.
+
+#### 2.6.2.6 Request service and check result
+
+![check_request_zh](/img/shenyu/plugin/tars/check_request_zh.png)
 
+# 3. How to disable plugin
 
-* Interface: The `serviceName` specified in the `@ShenyuTarsService` annotation.
+- In `shenyu-admin` --> BasicConfig --> Plugin --> `tars` set Status disable.
 
-* RpcType:choose `tars`.
+![close_tars_en](/img/shenyu/plugin/tars/close_tars_en.png)