You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shenyu.apache.org by fe...@apache.org on 2021/08/28 12:49:08 UTC
[incubator-shenyu-website] branch main updated: add client property
config doc (#210)
This is an automated email from the ASF dual-hosted git repository.
fengzhenbing pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/incubator-shenyu-website.git
The following commit(s) were added to refs/heads/main by this push:
new 74718aa add client property config doc (#210)
74718aa is described below
commit 74718aa22c043721e434692887dd81cd5ed953cd
Author: midnight2104 <33...@qq.com>
AuthorDate: Sat Aug 28 20:49:03 2021 +0800
add client property config doc (#210)
* update register center doc.
* add admin properties config doc.
* add client properties config doc.
* add client properties config doc.
---
content/en/projects/shenyu/_index.md | 2 +
.../projects/shenyu/admin-property-config/index.md | 10 +--
.../shenyu/client-property-config/index.md | 97 +++++++++++++++++++++
.../projects/shenyu/admin-property-config/index.md | 5 +-
.../shenyu/client-property-config/index.md | 90 +++++++++++++++++++
.../config/shenyu_client_application_config.png | Bin 0 -> 91167 bytes
6 files changed, 197 insertions(+), 7 deletions(-)
diff --git a/content/en/projects/shenyu/_index.md b/content/en/projects/shenyu/_index.md
index 82634aa..f2d9eaa 100644
--- a/content/en/projects/shenyu/_index.md
+++ b/content/en/projects/shenyu/_index.md
@@ -92,6 +92,8 @@ sidebar:
sub:
- title: 'Admin Property Config'
link: 'admin-property-config'
+ - title: 'Client Property Config'
+ link: 'client-property-config'
- title: 'Data Synchronization Config'
link: 'use-data-sync'
- title: 'Application Client Access Config'
diff --git a/content/en/projects/shenyu/admin-property-config/index.md b/content/en/projects/shenyu/admin-property-config/index.md
index 96ed3ee..8115009 100644
--- a/content/en/projects/shenyu/admin-property-config/index.md
+++ b/content/en/projects/shenyu/admin-property-config/index.md
@@ -6,7 +6,8 @@ description: Admin Property Config
This paper mainly explains how to configure Apache ShenYu properties on the admin side.
-<img src="/img/shenyu/config/shenyu_admin_application_config.png" width="60%" height="50%" />
+<img src="/img/shenyu/config/shenyu_admin_application_config.png" width="80%" height="70%" />
+
### Property Config
@@ -93,14 +94,13 @@ shenyu:
##### shenyu.register config
-This section describes configurations related to client access. For details about client access principles, see: [Application Client Access](../register-center-design) , for client access configuration, see: [Application Client Access Config](../register-center-access).
+This section describes configurations related to client access. For details about client access principles, see: [Application Client Access](../register-center-design) , for client access configuration, see: [Application Client Access Config](../register-center-access) .
|Name | Type | Default | Required | Description |
|:------------------------ |:----- |:-------: |:-------:|:----------------------------|
-|registerType |String | http | Yes | Which mode to use for registry. Currently, Http, Zookeeper, Etcd, Consul and Nacos are supported.|
+|registerType |String | http | Yes | Which mode to use for registry. Currently, http, zookeeper, etcd, consul and nacos are supported.|
|serverLists |String | null | No |Configure the address of the registry. If `http` is used, you do not need to enter this parameter. In clustering, multiple addresses are separated by commas (,).|
-|props | | | | The value of the attribute varies according to the registerType.|
-
+|props | | | | The value of the property varies according to the registerType.|
- `props` config
diff --git a/content/en/projects/shenyu/client-property-config/index.md b/content/en/projects/shenyu/client-property-config/index.md
new file mode 100644
index 0000000..79bfa60
--- /dev/null
+++ b/content/en/projects/shenyu/client-property-config/index.md
@@ -0,0 +1,97 @@
+---
+title: Client Property Config
+keywords: Apache ShenYu
+description: Client Property Config
+---
+
+This paper mainly explains how to configure the properties of Apache ShenYu when the client accesses the gateway.
+
+
+Set the `shenyu` property in your microservice, for example, in [shenyu-examples-http](https://github.com/apache/incubator-shenyu/tree/master/shenyu-examples/shenyu-examples-http) :
+
+<img src="/img/shenyu/config/shenyu_client_application_config.png" width="80%" height="70%" />
+
+### Property Config
+
+```yaml
+shenyu:
+ client:
+ registerType: http #zookeeper #etcd #nacos #consul
+ serverLists: http://localhost:9095 #localhost:2181 #http://localhost:2379 #localhost:8848
+ props:
+ contextPath: /http
+ appName: http
+ port: 8189
+ nacosNameSpace: ShenyuRegisterCenter
+
+```
+
+
+### Property Detail
+
+##### shenyu.client config
+
+This section describes configurations related to client access. For details about client access principles, see: [Application Client Access](../register-center-design) , for client access configuration, see: [Application Client Access Config](../register-center-access) .
+
+
+
+|Name | Type | Default | Required | Description |
+|:------------------------ |:----- |:-------: |:-------:|:----------------------------|
+|registerType |String | http | Yes | Which mode to use for registry. Currently, http, zookeeper, etcd, consul and nacos are supported.|
+|serverLists |String | null | No |Configure the address of the registry. In clustering, multiple addresses are separated by commas (,).|
+|props | | | | The value of the property varies according to the registerType.|
+
+
+
+- `props` config
+
+When microservices are built by different protocols, the property configuration is slightly different. The general attributes are as follows:
+
+
+
+|Name | Type | Default | Required | Description |
+|:------------------------ |:----- |:-------: |:-------:|:----------------------------|
+|contextPath |String | null | Yes |The route prefix of the microservice in the gateway.|
+|appName |String | null | Yes |microservice name. `springcloud` service don't set, please set `spring.application.name`.|
+|host |String | null | Yes | microservice address|
+|port |int | null | Yes | microservice port|
+|isFull |boolean | false | No | Whether to proxy the all service, currently just applies to `springmvc`/ `springcloud`|
+|ipAndPort |String | null | No | Service IP and port address, currently just applies to `gRPC` Proxy.|
+|shutdownWaitTime |int | 3000 | No | shutdown wait time(millisecond)|
+|delayOtherHooksExecTime |int | 2000 | No | `hook` execute time(millisecond)|
+|applicationShutdownHooksClassName |String | `java.lang.ApplicationShutdownHooks` | No | `hook` execute class name|
+|applicationShutdownHooksFieldName |String | `hooks` | No | `hook` execute field name |
+
+
+The value of the property varies according to the `registerType`.
+
+When the registerType is `nacos`, there has no other properties.
+
+
+
+When the registerType is `zookeeper`, the supported properties are as follows.
+
+|Name | Type | Default | Required | Description |
+|:------------------------ |:----- |:-------: |:-------:|:----------------------------|
+|sessionTimeout | int | 30000 | No |session time out(millisecond)|
+|connectionTimeout | int | 3000 | No |connection time out(millisecond)|
+
+When the registerType is `etcd`, the supported properties are as follows.
+
+|Name | Type | Default | Required | Description |
+|:------------------------ |:----- |:-------: |:-------:|:----------------------------|
+|etcdTimeout | int | 30000 | No |etcd time out(millisecond)|
+|etcdTTL | int | 5 | No |client lease time to live(second)|
+
+When the registerType is `nacos`, the supported properties are as follows.
+
+|Name | Type | Default | Required | Description |
+|:------------------------ |:----- |:-------: |:-------:|:----------------------------|
+|nacosNameSpace | String | null | Yes |namespace |
+|username | String | "" | No |username|
+|password | String | "" | No |password|
+|accessKey | String | "" | No |accessKey|
+|secretKey | String | "" | No |secretKey|
+
+
+When the registerType is `consul`, no other property configuration is provided. please set `spring.cloud.consul` for the configuration.
diff --git a/content/zh/projects/shenyu/admin-property-config/index.md b/content/zh/projects/shenyu/admin-property-config/index.md
index 7f79b91..413aaef 100644
--- a/content/zh/projects/shenyu/admin-property-config/index.md
+++ b/content/zh/projects/shenyu/admin-property-config/index.md
@@ -7,7 +7,8 @@ description: Admin属性配置
本篇主要讲解如何在 `admin`端配置 `ShenYu` 的相关属性。
-<img src="/img/shenyu/config/shenyu_admin_application_config.png" width="60%" height="50%" />
+<img src="/img/shenyu/config/shenyu_admin_application_config.png" width="80%" height="70%" />
+
### 属性配置
@@ -97,7 +98,7 @@ shenyu:
|名称 | 类型 | 默认值 | 是否必填 | 说明 |
|:------------------------ |:----- |:-------: |:-------:|:----------------------------|
-|registerType |String | http | 必填 |使用哪种方式进行服务注册,当前支持 `Http`、`Zookeeper`、`Etcd`、`Consul`和`Nacos` 。|
+|registerType |String | http | 必填 |使用哪种方式进行服务注册,当前支持 `http`、`zookeeper`、`etcd`、`consul`和`nacos` 。|
|serverLists |String | 无 | 非必填 |配置中心的地址。使用`http`方式时,不需要填写,其他类型需要填写。集群时,多个地址用 `,` 分开 。|
|props | | | | 使用不同注册类型时,属性取值不同。|
diff --git a/content/zh/projects/shenyu/client-property-config/index.md b/content/zh/projects/shenyu/client-property-config/index.md
new file mode 100644
index 0000000..3e16f36
--- /dev/null
+++ b/content/zh/projects/shenyu/client-property-config/index.md
@@ -0,0 +1,90 @@
+---
+title: 客户端属性配置
+keywords: Apache ShenYu
+description: Client属性配置
+---
+
+本篇主要讲解如何在客户端接入时配置 `ShenYu` 的相关属性。
+
+在你的微服务中设置`shenyu`属性,比如,在[shenyu-examples-http](https://github.com/apache/incubator-shenyu/tree/master/shenyu-examples/shenyu-examples-http) 中相关配置如下:
+
+<img src="/img/shenyu/config/shenyu_client_application_config.png" width="80%" height="70%" />
+
+### 属性配置
+
+```yaml
+shenyu:
+ client:
+ registerType: http #zookeeper #etcd #nacos #consul
+ serverLists: http://localhost:9095 #localhost:2181 #http://localhost:2379 #localhost:8848
+ props:
+ contextPath: /http
+ appName: http
+ port: 8189
+ nacosNameSpace: ShenyuRegisterCenter
+
+```
+
+
+### 属性详解
+
+##### shenyu.client 配置
+
+这是客户端接入的相关配置,客户端接入原理请参考:[客户端接入原理](../register-center-design) ,客户端接入配置请参考: [客户端接入配置](../register-center-access) 。
+
+|名称 | 类型 | 默认值 | 是否必填 | 说明 |
+|:------------------------ |:----- |:-------: |:-------:|:----------------------------|
+|registerType |String | http | 必填 |使用哪种方式进行服务注册,当前支持 `http`、`zookeeper`、`etcd`、`consul`和`nacos` 。|
+|serverLists |String | 无 | 必填 |配置中心的地址。集群时,多个地址用 `,` 分开 。|
+|props | | | | 使用不同注册类型时,属性取值不同。|
+
+
+- `props`配置
+
+微服务由不同协议构建时,属性配置略有不同,通用属性如下:
+
+
+|名称 | 类型 | 默认值 | 是否必填 | 说明 |
+|:------------------------ |:----- |:-------: |:-------:|:----------------------------|
+|contextPath |String | 无 | 是 |服务在网关中的路由前缀|
+|appName |String | 无 | 是 |服务名称。`springcloud`服务无需配置,请通过`spring.application.name`配置。|
+|host |String | 无 | 是 | 服务地址|
+|port |int | 无 | 是 | 服务端口|
+|isFull |boolean | false | 否 | 是否代理整个服务,目前适用于`springmvc`/`springcloud`|
+|ipAndPort |String | 无 | 否 | 服务的IP和端口地址,目前适用于`gRPC`。|
+|shutdownWaitTime |int | 3000 | 否 | 服务停止等待时间(毫秒)|
+|delayOtherHooksExecTime |int | 2000 | 否 | `hook`执行时间(毫秒)|
+|applicationShutdownHooksClassName |String | `java.lang.ApplicationShutdownHooks` | 否 | `hook`执行类|
+|applicationShutdownHooksFieldName |String | `hooks` | 否 | `hook`执行字段|
+
+
+使用不同的注册类型时,属性取值不同。
+当注册类型为`http`时,暂未提供其他属性配置。
+
+
+
+当注册类型为`zookeeper`时,支持的属性配置如下:
+
+|名称 | 类型 | 默认值 | 是否必填 | 说明 |
+|:------------------------ |:----- |:-------: |:-------:|:----------------------------|
+|sessionTimeout | int | 30000 | 否 |session超时时间(毫秒)|
+|connectionTimeout | int | 3000 | 否 |连接超时时间(毫秒)|
+
+当注册类型为`etcd`时,支持的属性配置如下:
+
+|名称 | 类型 | 默认值 | 是否必填 | 说明 |
+|:------------------------ |:----- |:-------: |:-------:|:----------------------------|
+|etcdTimeout | int | 30000 | 否 |etcd超时时间(毫秒)|
+|etcdTTL | int | 5 | 否 |租约生存时间(秒)|
+
+当注册类型为`nacos`时,支持的属性配置如下:
+
+|名称 | 类型 | 默认值 | 是否必填 | 说明 |
+|:------------------------ |:----- |:-------: |:-------:|:----------------------------|
+|nacosNameSpace | String | 无 | 是 |命名空间|
+|username | String | 空字符串 | 否 |用户名|
+|password | String | 空字符串 | 否 |密码|
+|accessKey | String | 空字符串 | 否 |accessKey|
+|secretKey | String | 空字符串 | 否 |secretKey|
+
+当注册类型为`consul`时,暂未提供其他属性配置。请通过`spring.cloud.consul`进行配置。
\ No newline at end of file
diff --git a/static/img/shenyu/config/shenyu_client_application_config.png b/static/img/shenyu/config/shenyu_client_application_config.png
new file mode 100644
index 0000000..8e879a4
Binary files /dev/null and b/static/img/shenyu/config/shenyu_client_application_config.png differ