This is an automated email from the ASF dual-hosted git repository.
midnight2104 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 aead91b add Gateway Configuration document. (#216)
aead91b is described below
commit aead91beca5178eb342114a8e136bcf3377b8150
Author: ttttangzhen <[email protected]>
AuthorDate: Thu Sep 2 13:09:33 2021 +0800
add Gateway Configuration document. (#216)
* add Gateway Configuration document.
* revert old version
* revert old version
* fix mdlink
* fix mdlink
* fix mdlink
* update spi img path
---
community/1-Apache-ShenYu-Code-Conduct.md | 2 +-
docs/developer/spi/custom-condition-match.md | 2 +-
docs/developer/spi/custom-load-balance.md | 2 +-
docs/developer/spi/custom-metrics-monitor.md | 2 +-
docs/developer/spi/custom-rate-limiter.md | 2 +-
.../property-config/gateway-property-config.md | 234 +++++++++++++++++++++
.../current/1-Apache-ShenYu-Code-Conduct.md | 2 +-
.../developer/spi/custom-load-balance.md | 2 +-
.../developer/spi/custom-metrics-monitor.md | 2 +-
.../developer/spi/custom-rate-limiter.md | 2 +-
.../property-config/gateway-property-config.md | 230 ++++++++++++++++++++
.../developer/spi/custom-condition-match.md | 2 +-
.../developer/spi/custom-load-balance.md | 2 +-
.../developer/spi/custom-metrics-monitor.md | 2 +-
.../developer/spi/custom-rate-limiter.md | 2 +-
.../property-config/gateway-property-config.md | 230 ++++++++++++++++++++
.../config/shenyu_gateway_application_config.jpg | Bin 0 -> 93244 bytes
.../developer/spi/custom-condition-match.md | 2 +-
.../developer/spi/custom-load-balance.md | 2 +-
.../developer/spi/custom-metrics-monitor.md | 2 +-
.../developer/spi/custom-rate-limiter.md | 2 +-
.../property-config/gateway-property-config.md | 234 +++++++++++++++++++++
22 files changed, 945 insertions(+), 17 deletions(-)
diff --git a/community/1-Apache-ShenYu-Code-Conduct.md
b/community/1-Apache-ShenYu-Code-Conduct.md
index e12ce1b..fb38d50 100755
--- a/community/1-Apache-ShenYu-Code-Conduct.md
+++ b/community/1-Apache-ShenYu-Code-Conduct.md
@@ -71,4 +71,4 @@ cover: "/img/architecture/shenyu-framework.png"
- Actual values of test cases should be named `actualXXX`, expected values
`expectedXXX`.
- Class for test case and `@Test` annotation do not need javadoc.
-**The content is referenced from the Apache ShardingSphere code conduct with
appropriate adjustments.**
\ No newline at end of file
+**The content is referenced from the Apache ShardingSphere code conduct with
appropriate adjustments.**
diff --git a/docs/developer/spi/custom-condition-match.md
b/docs/developer/spi/custom-condition-match.md
index 0973fcc..a95c087 100644
--- a/docs/developer/spi/custom-condition-match.md
+++ b/docs/developer/spi/custom-condition-match.md
@@ -35,7 +35,7 @@ ${you spi name} = ${you class path}
* In the `Admin` service ---> BasicConfig ---> Dictionary , Find the
dictionary code as `MATCH_MODE`, add a new piece of data, pay attention to the
dictionary name: `${you spi name}`.
-<img src="/static/img/shenyu/custom/custom-condition-match-en.png" width="40%"
height="30%" />
+<img src="/img/shenyu/custom/custom-condition-match-en.png" width="40%"
height="30%" />
* Or execute the following custom `SQL` statement:
diff --git a/docs/developer/spi/custom-load-balance.md
b/docs/developer/spi/custom-load-balance.md
index 3f412ae..c5f13de 100644
--- a/docs/developer/spi/custom-load-balance.md
+++ b/docs/developer/spi/custom-load-balance.md
@@ -41,7 +41,7 @@ ${you spi name} = ${you class path}
* In the `Admin` service ---> BasicConfig ---> Dictionary , Find the
dictionary code as `LOAD_BALANCE`, add a new piece of data, pay attention to
the dictionary name: `${you spi name}`.
-<img src="/static/img/shenyu/custom/custom-load-balance-en.jpg" width="40%"
height="30%" />
+<img src="/img/shenyu/custom/custom-load-balance-en.jpg" width="40%"
height="30%" />
* Or execute the following custom `SQL` statement:
diff --git a/docs/developer/spi/custom-metrics-monitor.md
b/docs/developer/spi/custom-metrics-monitor.md
index d02db1f..dc415dc 100644
--- a/docs/developer/spi/custom-metrics-monitor.md
+++ b/docs/developer/spi/custom-metrics-monitor.md
@@ -46,7 +46,7 @@ ${you spi name} = ${you class path}
* In the `Admin` service ---> BasicConfig ---> Plugin , Find the `Monitor`
plugin, edit config, pay attention to the `metricsName` name: `${you spi
name}`.
-<img src="/static/img/shenyu/custom/custom-metrics-monitor-en.jpg" width="40%"
height="30%" />
+<img src="/img/shenyu/custom/custom-metrics-monitor-en.jpg" width="40%"
height="30%" />
diff --git a/docs/developer/spi/custom-rate-limiter.md
b/docs/developer/spi/custom-rate-limiter.md
index ba0c21e..f064708 100644
--- a/docs/developer/spi/custom-rate-limiter.md
+++ b/docs/developer/spi/custom-rate-limiter.md
@@ -58,7 +58,7 @@ ${you spi name} = ${you class path}
* In the `Admin` service ---> BasicConfig ---> Dictionary , Find the
dictionary code as `ALGORITHM_*`, add a new piece of data, pay attention to the
dictionary name: `${you spi name}`.
-<img src="/static/img/shenyu/custom/custom-rate-limiter-en.jpg" width="40%"
height="30%" />
+<img src="/img/shenyu/custom/custom-rate-limiter-en.jpg" width="40%"
height="30%" />
* Or execute the following custom `SQL` statement:
diff --git a/docs/user-guide/property-config/gateway-property-config.md
b/docs/user-guide/property-config/gateway-property-config.md
new file mode 100644
index 0000000..8f6ffa8
--- /dev/null
+++ b/docs/user-guide/property-config/gateway-property-config.md
@@ -0,0 +1,234 @@
+---
+title: Gateway Property Config
+keywords: ["Config"]
+description: Gateway Property Config
+---
+
+This paper mainly explains how to configure `Apache ShenYu` properties on the
gateway side.
+
+<img src="/img/shenyu/config/shenyu_gateway_application_config.jpg"
width="80%" height="70%" />
+
+### Property Config
+
+```yaml
+shenyu:
+# httpclient:
+# strategy: webClient
+# connectTimeout: 45000
+# readTimeout: 3000
+# writeTimeout: 3000
+# wiretap: false
+# pool:
+# type: ELASTIC
+# name: proxy
+# maxConnections: 16
+# acquireTimeout: 45000
+# proxy:
+# host:
+# port:
+# username:
+# password:
+# nonProxyHostsPattern:
+# ssl:
+# useInsecureTrustManager: false
+# trustedX509Certificates:
+# handshakeTimeout:
+# closeNotifyFlushTimeout:
+# closeNotifyReadTimeout:
+# defaultConfigurationType:
+ file:
+ enabled: true
+ cross:
+ enabled: true
+ exclude:
+ enabled: false
+ paths:
+ - /favicon.ico
+ sync:
+ websocket:
+ urls: ws://localhost:9095/websocket
+# zookeeper:
+# url: localhost:2181
+# sessionTimeout: 5000
+# connectionTimeout: 2000
+# http:
+# url: http://localhost:9095
+# nacos:
+# url: localhost:8848
+# namespace: 1c10d748-af86-43b9-8265-75f487d20c6c
+# username:
+# password:
+# acm:
+# enabled: false
+# endpoint: acm.aliyun.com
+# namespace:
+# accessKey:
+# secretKey:
+# etcd:
+# url: http://localhost:2379
+# consul:
+# url: http://localhost:8500
+# waitTime: 1000
+# watchDelay: 1000
+```
+
+### Property Detail
+
+##### shenyu.httpclient config
+
+This is the HttpClient configuration used to send proxy requests after
proxying the Http and SpringCloud protocols in the `ShenYu` gateway.
+
+| Name | Type | Default | Required | Description
|
+| :------------- | :-----: | :-----------: | :------: |
:----------------------------------------------------------- |
+| strategy | String | webcwebClient | No | The strategy of
httpClientPlugin |
+| connectTimeout | int | 45000 | No | Connection timeout
(millisecond), the default value is 45000. |
+| readTimeout | int | 3000 | No | Read timeout
(millisecond), the default value is 3000. |
+| writeTimeout | int | 3000 | No | Write timeout
(millisecond), the default value is 3000. |
+| wiretap | Boolean | false | No | Enables wiretap
debugging for Netty HttpClient, the default value is 'false'. |
+| pool | | | | HttpClient connection
pool config |
+| proxy | | | | HttpClient proxy
config |
+| ssl | | | | HttpClient ssl config
|
+
+- `pool` config
+
+HttpClient connection pool configuration:
+
+| Name | Type | Default | Required |
Description |
+| :------------- | :----: | :-------------------------------: | :------: |
:----------------------------------------------------------- |
+| type | String | ELASTIC | No |
Type of pool for HttpClient to use, defaults to ELASTIC.<br /> - ELASTIC: The
connection pool can be cached and grown on demand<br />- FIXED: The connection
pool cache and reuse a fixed maximum The number of connections.<br />-
DISABLED: The connection pool will always create a new connection. |
+| name | String | proxy | No | The
channel pool map name, defaults to proxy. |
+| maxConnections | int | the maximum value of 2*CPU and 16 | No |
Only for type FIXED, the maximum number of connections before starting pending
acquisition on existing ones.<br />the default value is available number of
processors*2. <br /> (but with a minimum value of 16) |
+| acquireTimeout | int | 45000 | No |
Only for type FIXED, the maximum time in millis to wait for aquiring. the
default value is 45000 |
+
+- `proxy` config
+
+Netty HttpClient proxy configuration:
+
+| Name | Type | Default | Required | Description
|
+| :------------------- | :----: | :-----: | :------: |
:----------------------------------------------------------- |
+| host | String | null | No | Hostname for proxy
configuration of Netty HttpClient. |
+| port | String | null | No | Port for proxy
configuration of Netty HttpClient. |
+| username | String | null | No | Username for proxy
configuration of Netty HttpClient. |
+| password | String | null | No | Password for proxy
configuration of Netty HttpClient. |
+| nonProxyHostsPattern | String | null | No | Regular expression
(Java) for a configured list of hosts. that should be reached directly,
bypassing the proxy |
+
+- `SSL` config
+
+Gateway routing can support routing to http and https back-end services at the
same time. The following is the SSL-related configuration:
+
+| Name | Type | Default | Required | Description
|
+| :----------------------- | :-----: | :-----: | :------: |
:----------------------------------------------------------- |
+| useInsecureTrustManager | Boolean | false | No | Installs the netty
InsecureTrustManagerFactory. This is insecure and not suitable for production. |
+| trustedX509Certificates | String | Null | No | Trusted
certificates for verifying the remote endpoint's certificate.(Use `,` to
separate multiple values) |
+| handshakeTimeout | int | 10000 | No | SSL handshake
timeout. Default to 10000 ms |
+| closeNotifyFlushTimeout | int | 3000 | No | SSL close_notify
flush timeout. Default to 3000 ms. |
+| closeNotifyReadTimeout | int | 0 | No | SSL close_notify
read timeout. Default to 0 ms. |
+| defaultConfigurationType | String | TCP | No | The default ssl
configuration type. Defaults to TCP.<br />- H2: SslProvider will be set
depending on OpenSsl.isAlpnSupported(), SslProvider.HTTP2_CIPHERS, ALPN
support, HTTP/1.1 and HTTP/2 support.<br />- TCP:
[`SslProvider`](https://netty.io/4.1/api/io/netty/handler/ssl/SslProvider.html?is-external=true)
will be set depending on `OpenSsl.isAvailable()`<br />- NONE: There will be no
default configuration |
+
+
+
+##### Filter Configuration
+
+- `shenyu.file` config
+
+File filter properties:
+
+|Name | Type | Default | Required | Description
|
+|:------------------------ |:----- |:-------:
|:-------:|:----------------------------|
+| enabled | Boolean | false | No | enable file size filtering |
+
+
+
+
+- `shenyu.cross` config
+
+Cross filter properties:
+
+
+|Name | Type | Default | Required | Description
|
+|:------------------------ |:----- |:-------:
|:-------:|:----------------------------|
+| enabled | Boolean | false | No | allow cross-domain requests |
+
+
+
+- `shenyu.exclude` config
+
+Exculde filter properties:
+
+|Name | Type | Default | Required | Description
|
+|:------------------------ |:----- |:-------:
|:-------:|:----------------------------|
+| enabled | Boolean | false | No | whether to enable `exclude filter`
and reject the specified request to pass through the gateway |
+| paths | Array | null | Yes | Requests matching this list can
not pass through the gateway (support Path-Matching) |
+
+
+
+##### shenyu.sync config
+
+The Apache ShenYu gateway and the Admin System use data synchronization
configurations.
+
+
+The following properties are configured for data synchronization using
`websocket` :
+
+|Name | Type | Default | Required | Description
|
+|:------------------------ |:----- |:-------:
|:-------:|:----------------------------|
+| urls | String | null | Yes | The websocket server address of
`Admin`, separate multiple addresses with `,` |
+
+
+
+The following properties are configured for data synchronization using
`zookeeper` :
+
+
+|Name | Type | Default | Required | Description
|
+|:------------------------ |:----- |:-------:
|:-------:|:----------------------------|
+|url | String | null | Yes |zookeeper server url|
+|sessionTimeout | int | null | Yes |session timeout
(millisecond)|
+|connectionTimeout | int | null | Yes |connection timeout
(millisecond)|
+
+
+
+The following properties are configured for data synchronization using `http
long polling` :
+
+|Name | Type | Default | Required | Description
|
+|:------------------------ |:----- |:-------:
|:-------:|:----------------------------|
+| url | String | null | Yes | `Admin` server address |
+
+
+
+The following properties are configured for data synchronization using `nacos`
:
+
+|Name | Type | Default | Required | Description
|
+|:------------------------ |:----- |:-------:
|:-------:|:----------------------------|
+|url | String | null | 是 |nacos url|
+|namespace | String | null | Yes |namespace|
+|username | String | null | No |username|
+|password | String | null | No |password|
+|acm | | | No |aliyun ACM service configuration|
+
+- `acm` config
+
+|Name | Type | Default | Required | Description
|
+|:------------------------ |:----- |:-------:
|:-------:|:----------------------------|
+|enabled | boolean | false | No |whether to enable|
+|endpoint | String | null | No |ACM service address|
+|namespace | String | null | No |namespace|
+|accessKey | String | null | No |accessKey|
+|secretKey | String | null | No |secretKey|
+
+
+
+The following properties are configured for data synchronization using `etcd` :
+
+|Name | Type | Default | Required | Description
|
+|:------------------------ |:----- |:-------:
|:-------:|:----------------------------|
+|url | String | null | Yes |`etcd` server url|
+
+
+
+The following properties are configured for data synchronization using
`consul` :
+
+|Name | Type | Default | Required | Description
|
+|:------------------------ |:----- |:-------:
|:-------:|:----------------------------|
+|url | String | null | Yes |`consul` server url|
+| waitTime | int | null | Yes | the timeout period for requesting
consul service to pull configuration information (milliseconds) |
+|watchDelay | int | null | Yes |Synchronization interval (milliseconds)|
+
diff --git
a/i18n/zh/docusaurus-plugin-content-docs-community/current/1-Apache-ShenYu-Code-Conduct.md
b/i18n/zh/docusaurus-plugin-content-docs-community/current/1-Apache-ShenYu-Code-Conduct.md
index 86a802d..54de389 100755
---
a/i18n/zh/docusaurus-plugin-content-docs-community/current/1-Apache-ShenYu-Code-Conduct.md
+++
b/i18n/zh/docusaurus-plugin-content-docs-community/current/1-Apache-ShenYu-Code-Conduct.md
@@ -74,4 +74,4 @@ cover: "/img/architecture/shenyu-framework.png"
- 测试用例的真实值应名为为actualXXX,期望值应命名为expectedXXX。
- 测试类和`@Test`标注的方法无需javadoc。
-**以上内容参考了Apache ShardingSphere的编码指南,并做了适当调整。**
\ No newline at end of file
+**以上内容参考了Apache ShardingSphere的编码指南,并做了适当调整。**
diff --git
a/i18n/zh/docusaurus-plugin-content-docs/version-2.4.0/developer/spi/custom-load-balance.md
b/i18n/zh/docusaurus-plugin-content-docs/current/developer/spi/custom-load-balance.md
similarity index 95%
copy from
i18n/zh/docusaurus-plugin-content-docs/version-2.4.0/developer/spi/custom-load-balance.md
copy to
i18n/zh/docusaurus-plugin-content-docs/current/developer/spi/custom-load-balance.md
index dfeba56..36bacbe 100644
---
a/i18n/zh/docusaurus-plugin-content-docs/version-2.4.0/developer/spi/custom-load-balance.md
+++
b/i18n/zh/docusaurus-plugin-content-docs/current/developer/spi/custom-load-balance.md
@@ -41,7 +41,7 @@ ${you spi name} = ${you class path}
* 在 `Admin` 后台 ---> 基础管理 ---> 字典管理 , 找到字典编码为 `LOAD_BALANCE`,新增一条数据,注意字典名称要为:
`${you spi name}`。
-<img src="/static/img/shenyu/custom/custom-load-balance-zh.jpg" width="40%"
height="30%" />
+<img src="/img/shenyu/custom/custom-load-balance-zh.jpg" width="40%"
height="30%" />
* 或者执行以下自定义`SQL`语句:
diff --git
a/i18n/zh/docusaurus-plugin-content-docs/version-2.4.0/developer/spi/custom-metrics-monitor.md
b/i18n/zh/docusaurus-plugin-content-docs/current/developer/spi/custom-metrics-monitor.md
similarity index 93%
copy from
i18n/zh/docusaurus-plugin-content-docs/version-2.4.0/developer/spi/custom-metrics-monitor.md
copy to
i18n/zh/docusaurus-plugin-content-docs/current/developer/spi/custom-metrics-monitor.md
index b25042c..f9bc5a1 100644
---
a/i18n/zh/docusaurus-plugin-content-docs/version-2.4.0/developer/spi/custom-metrics-monitor.md
+++
b/i18n/zh/docusaurus-plugin-content-docs/current/developer/spi/custom-metrics-monitor.md
@@ -44,7 +44,7 @@ ${you spi name} = ${you class path}
```
* 在 `Admin` 后台 ---> 基础管理 ---> 插件管理 , 找到 `Monitor`
插件,编辑插件信息,注意``metricsName要为: `${you spi name}`。
-<img src="/static/img/shenyu/custom/custom-metrics-monitor-zh.jpg" width="40%"
height="30%" />
+<img src="/img/shenyu/custom/custom-metrics-monitor-zh.jpg" width="40%"
height="30%" />
diff --git
a/i18n/zh/docusaurus-plugin-content-docs/version-2.4.0/developer/spi/custom-rate-limiter.md
b/i18n/zh/docusaurus-plugin-content-docs/current/developer/spi/custom-rate-limiter.md
similarity index 95%
copy from
i18n/zh/docusaurus-plugin-content-docs/version-2.4.0/developer/spi/custom-rate-limiter.md
copy to
i18n/zh/docusaurus-plugin-content-docs/current/developer/spi/custom-rate-limiter.md
index c1a43ce..40029b6 100644
---
a/i18n/zh/docusaurus-plugin-content-docs/version-2.4.0/developer/spi/custom-rate-limiter.md
+++
b/i18n/zh/docusaurus-plugin-content-docs/current/developer/spi/custom-rate-limiter.md
@@ -57,7 +57,7 @@ ${you spi name} = ${you class path}
* 在 `Admin` 后台 ---> 基础管理 ---> 字典管理 , 找到字典编码为 `ALGORITHM_*`,新增一条数据,注意字典名称要为:
`${you spi name}`。
-<img src="/static/img/shenyu/custom/custom-rate-limiter-zh.jpg" width="40%"
height="30%" />
+<img src="/img/shenyu/custom/custom-rate-limiter-zh.jpg" width="40%"
height="30%" />
* 或者执行以下自定义`SQL`语句:
diff --git
a/i18n/zh/docusaurus-plugin-content-docs/current/user-guide/property-config/gateway-property-config.md
b/i18n/zh/docusaurus-plugin-content-docs/current/user-guide/property-config/gateway-property-config.md
new file mode 100644
index 0000000..3842835
--- /dev/null
+++
b/i18n/zh/docusaurus-plugin-content-docs/current/user-guide/property-config/gateway-property-config.md
@@ -0,0 +1,230 @@
+---
+title: 网关属性配置
+keywords: ["配置"]
+description: 网关属性配置
+---
+
+本篇主要讲解如何在 `Apache Shenyu` 网关配置 `ShenYu` 的相关属性。
+
+<img src="/img/shenyu/config/shenyu_gateway_application_config.jpg"
width="80%" height="70%" />
+
+### 属性配置
+
+```yaml
+shenyu:
+# httpclient:
+# strategy: webClient
+# connectTimeout: 45000
+# readTimeout: 3000
+# writeTimeout: 3000
+# wiretap: false
+# pool:
+# type: ELASTIC
+# name: proxy
+# maxConnections: 16
+# acquireTimeout: 45000
+# proxy:
+# host:
+# port:
+# username:
+# password:
+# nonProxyHostsPattern:
+# ssl:
+# useInsecureTrustManager: false
+# trustedX509Certificates:
+# handshakeTimeout:
+# closeNotifyFlushTimeout:
+# closeNotifyReadTimeout:
+# defaultConfigurationType:
+ file:
+ enabled: true
+ cross:
+ enabled: true
+ exclude:
+ enabled: false
+ paths:
+ - /favicon.ico
+ sync:
+ websocket:
+ urls: ws://localhost:9095/websocket
+# zookeeper:
+# url: localhost:2181
+# sessionTimeout: 5000
+# connectionTimeout: 2000
+# http:
+# url: http://localhost:9095
+# nacos:
+# url: localhost:8848
+# namespace: 1c10d748-af86-43b9-8265-75f487d20c6c
+# username:
+# password:
+# acm:
+# enabled: false
+# endpoint: acm.aliyun.com
+# namespace:
+# accessKey:
+# secretKey:
+# etcd:
+# url: http://localhost:2379
+# consul:
+# url: http://localhost:8500
+# waitTime: 1000
+# watchDelay: 1000
+
+```
+
+### 属性详解
+
+##### shenyu.httpclient 配置
+
+这是 `ShenYu` 网关中代理Http及SpringCloud协议后,用于发送代理请求的HttpClient配置。
+
+| Name | Type | Default | Required | Description
|
+| :------------- | :-----: | :-----------: | :------: |
:----------------------------------------------------------- |
+| strategy | String | webcwebClient | No |
HttpClientPlugin实现策略(默认使用webClietn):<br />- `webClient`:使用WebClientPlugin<br
/>- `netty`:使用NettyHttpClientPlugin |
+| connectTimeout | int | 45000 | No | 连接超时时间 (毫秒),默认值为
`45000`. |
+| readTimeout | int | 3000 | No | 读取超时 (毫秒),默认值为 `3000`.
|
+| writeTimeout | int | 3000 | No | 输出超时
(millisecond),默认值为 `3000`. |
+| wiretap | Boolean | false | No | 启用 Netty HttpClient
的窃听调试,默认值为 `false`。 |
+| pool | | | | HttpClient连接池配置
|
+| proxy | | | | HttpClient代理配置
|
+| ssl | | | | HttpClient SSL配置
|
+
+- `pool` config
+
+HttpClient连接池配置:
+
+| Name | Type | Default | Required |
Description |
+| :------------- | :----: | :------------------------: | :------: |
:----------------------------------------------------------- |
+| type | String | ELASTIC | No |
HttpClient连接池类型,默认值为`ELASTIC`。<br /> - `ELASTIC`: 连接池可以按需缓存和增长。<br />- `FIXED`:
连接池缓存并重用,有固定的最大连接数。<br />- `DISABLED`: 连接池总是会创建一个新的连接。 |
+| name | String | proxy | No |
连接池映射名称,默认为`proxy`。 |
+| maxConnections | int | 2*可用处理器数,最小值为16 | No | 仅适用于 `FIXED`
类型,在现有连接上开始挂起获取之前的最大连接数。<br />默认值为可用处理器数*2。<br /> (最小值为 16) |
+| acquireTimeout | int | 45000 | No | 仅适用于
`FIXED` 类型,等待获取连接的最长时间(毫秒)。默认值为 45000 |
+
+- `Proxy` config
+
+Netty HttpClient 代理的相关配置:
+
+| Name | Type | Default | Required | Description
|
+| :------------------- | :----: | :-----: | :------: |
:---------------------------------- |
+| host | String | null | No | Netty HttpClient
代理配置的主机名。 |
+| port | String | null | No | Netty HttpClient
的代理配置端口。 |
+| username | String | null | No | Netty HttpClient
代理配置的用户名。 |
+| password | String | null | No | Netty HttpClient
代理配置的密码。 |
+| nonProxyHostsPattern | String | null | No | 直连的主机列表的正则表达式 (Java)。 |
+
+- `SSL` config
+
+网关路由可以同时支持路由到http和https的后端服务,以下为SSL相关配置:
+
+| Name | Type | Default | Required | Description
|
+| :----------------------- | :-----: | :-----: | :------: |
:----------------------------------------------------------- |
+| useInsecureTrustManager | Boolean | false | No |
是否信任所有下游证书,默认`false` |
+| trustedX509Certificates | Array | Null | No | 配置自己的信任的证书列表。
|
+| handshakeTimeout | int | 10000 | No |
SSL握手超时时间(毫秒),默认值为10000 |
+| closeNotifyFlushTimeout | int | 3000 | No | SSL close_notify
刷新超时(毫秒)默认值为 3000. |
+| closeNotifyReadTimeout | int | 0 | No | SSL close_notify
读取超时(毫秒)默认值为 0. |
+| defaultConfigurationType | String | TCP | No | SslContextBuilder
的默认配置, 默认为 TCP.<br />- H2: SslProvider 将根据
OpenSsl.isAlpnSupported()、SslProvider.HTTP2_CIPHERS、ALPN 支持、HTTP/1.1 和 HTTP/2
支持进行设置<br />- TCP: SslProvider 将根据 OpenSsl.isAvailable() 设置<br />- NONE:
不会有默认配置 |
+
+
+
+##### 过滤器相关配置
+
+- `shenyu.file` 配置
+
+文件过滤器的相关配置。
+
+| 名称 | 类型 | 默认值 | 是否必填 | 说明 |
+| :------ | :------ | :----: | :------: | :------------------- |
+| enabled | Boolean | false | 否 | 是否开启文件大小过滤 |
+
+
+
+- `shenyu.cross` 配置
+
+跨域相关配置。
+
+| 名称 | 类型 | 默认值 | 是否必填 | 说明 |
+| :------ | :------ | :----: | :------: | :--------------- |
+| enabled | Boolean | false | 否 | 是否支持跨域请求 |
+
+
+
+- `shenyu.exclude` 配置
+
+拒绝指定请求经过网关的相关配置
+
+| 名称 | 类型 | 默认值 | 是否必填 | 说明 |
+| :------ | :------ | :----: | :------: |
:----------------------------------------- |
+| enabled | Boolean | false | 否 | 是否拒绝指定请求经过网关 |
+| paths | Array | 无 | 是 | 匹配该列表的请求不经过网关(支持路径匹配) |
+
+
+
+##### shenyu.sync 配置
+
+网关和`Admin`端使用数据同步的相关配置。
+
+使用`websocket`进行数据同步的属性配置如下:
+
+| 名称 | 类型 | 默认值 | 是否必填 | 说明 |
+| :--- | :----- | :----: | :------: |
:------------------------------------------------- |
+| urls | String | 无 | 是 | `Admin`的websocket服务地址,多个地址用 `,` 分开 。 |
+
+
+
+使用`zookeeper`进行数据同步的属性配置如下:
+
+| 名称 | 类型 | 默认值 | 是否必填 | 说明 |
+| :---------------- | :----- | :----: | :------: | :--------------------------
|
+| url | String | 无 | 是 | `zookeeper`的连接地址 |
+| sessionTimeout | int | 无 | 是 | `session`的超时时间(毫秒) |
+| connectionTimeout | int | 无 | 是 | 连接超时时间(毫秒) |
+
+
+
+使用`http长轮询`进行数据同步的属性配置如下:
+
+| 名称 | 类型 | 默认值 | 是否必填 | 说明 |
+| :--- | :----- | :----: | :------: | :---------------- |
+| url | String | 无 | 是 | `Admin`的服务地址 |
+
+
+
+使用`nacos`进行数据同步的属性配置如下:
+
+| 名称 | 类型 | 默认值 | 是否必填 | 说明 |
+| :-------- | :----- | :----: | :------: | :---------------- |
+| url | String | 无 | 是 | `nacos`连接地址 |
+| namespace | String | 无 | 是 | 命名空间 |
+| username | String | 无 | 否 | 用户名 |
+| password | String | 无 | 否 | 密码 |
+| acm | | | 否 | 阿里云ACM服务配置 |
+
+- `acm`配置
+
+| 名称 | 类型 | 默认值 | 是否必填 | 说明 |
+| :-------- | :------ | :----: | :------: | :---------- |
+| enabled | boolean | false | 否 | 是否启用 |
+| endpoint | String | 无 | 是 | ACM服务地址 |
+| namespace | String | 无 | 否 | namespace |
+| accessKey | String | 无 | 否 | accessKey |
+| secretKey | String | 无 | 否 | secretKey |
+
+
+
+使用`etcd`进行数据同步的属性配置如下:
+
+| 名称 | 类型 | 默认值 | 是否必填 | 说明 |
+| :--- | :----- | :----: | :------: | :------------- |
+| url | String | 无 | 是 | `etcd`连接地址 |
+
+
+
+使用`consul`进行数据同步的属性配置如下:
+
+| 名称 | 类型 | 默认值 | 是否必填 | 说明 |
+| :--------- | :----- | :----: | :------: |
:------------------------------------------- |
+| url | String | 无 | 是 | `consul`连接地址
|
+| waitTime | int | 无 | 是 | 请求consul服务拉取配置信息的超时时间(毫秒) |
+| watchDelay | int | 无 | 是 | 同步间隔(毫秒)
|
diff --git
a/i18n/zh/docusaurus-plugin-content-docs/version-2.4.0/developer/spi/custom-condition-match.md
b/i18n/zh/docusaurus-plugin-content-docs/version-2.4.0/developer/spi/custom-condition-match.md
index 517111c..864dac4 100644
---
a/i18n/zh/docusaurus-plugin-content-docs/version-2.4.0/developer/spi/custom-condition-match.md
+++
b/i18n/zh/docusaurus-plugin-content-docs/version-2.4.0/developer/spi/custom-condition-match.md
@@ -34,7 +34,7 @@ ${you spi name} = ${you class path}
* 在 `Admin` 后台 ---> 基础管理 ---> 字典管理 , 找到字典编码为 `MATCH_MODE`,新增一条数据,注意字典名称要为:
`${you spi name}`。
-<img src="/static/img/shenyu/custom/custom-condition-match-zh.png" width="40%"
height="30%" />
+<img src="/img/shenyu/custom/custom-condition-match-zh.png" width="40%"
height="30%" />
* 或者执行以下自定义`SQL`语句:
diff --git
a/i18n/zh/docusaurus-plugin-content-docs/version-2.4.0/developer/spi/custom-load-balance.md
b/i18n/zh/docusaurus-plugin-content-docs/version-2.4.0/developer/spi/custom-load-balance.md
index dfeba56..36bacbe 100644
---
a/i18n/zh/docusaurus-plugin-content-docs/version-2.4.0/developer/spi/custom-load-balance.md
+++
b/i18n/zh/docusaurus-plugin-content-docs/version-2.4.0/developer/spi/custom-load-balance.md
@@ -41,7 +41,7 @@ ${you spi name} = ${you class path}
* 在 `Admin` 后台 ---> 基础管理 ---> 字典管理 , 找到字典编码为 `LOAD_BALANCE`,新增一条数据,注意字典名称要为:
`${you spi name}`。
-<img src="/static/img/shenyu/custom/custom-load-balance-zh.jpg" width="40%"
height="30%" />
+<img src="/img/shenyu/custom/custom-load-balance-zh.jpg" width="40%"
height="30%" />
* 或者执行以下自定义`SQL`语句:
diff --git
a/i18n/zh/docusaurus-plugin-content-docs/version-2.4.0/developer/spi/custom-metrics-monitor.md
b/i18n/zh/docusaurus-plugin-content-docs/version-2.4.0/developer/spi/custom-metrics-monitor.md
index b25042c..f9bc5a1 100644
---
a/i18n/zh/docusaurus-plugin-content-docs/version-2.4.0/developer/spi/custom-metrics-monitor.md
+++
b/i18n/zh/docusaurus-plugin-content-docs/version-2.4.0/developer/spi/custom-metrics-monitor.md
@@ -44,7 +44,7 @@ ${you spi name} = ${you class path}
```
* 在 `Admin` 后台 ---> 基础管理 ---> 插件管理 , 找到 `Monitor`
插件,编辑插件信息,注意``metricsName要为: `${you spi name}`。
-<img src="/static/img/shenyu/custom/custom-metrics-monitor-zh.jpg" width="40%"
height="30%" />
+<img src="/img/shenyu/custom/custom-metrics-monitor-zh.jpg" width="40%"
height="30%" />
diff --git
a/i18n/zh/docusaurus-plugin-content-docs/version-2.4.0/developer/spi/custom-rate-limiter.md
b/i18n/zh/docusaurus-plugin-content-docs/version-2.4.0/developer/spi/custom-rate-limiter.md
index c1a43ce..40029b6 100644
---
a/i18n/zh/docusaurus-plugin-content-docs/version-2.4.0/developer/spi/custom-rate-limiter.md
+++
b/i18n/zh/docusaurus-plugin-content-docs/version-2.4.0/developer/spi/custom-rate-limiter.md
@@ -57,7 +57,7 @@ ${you spi name} = ${you class path}
* 在 `Admin` 后台 ---> 基础管理 ---> 字典管理 , 找到字典编码为 `ALGORITHM_*`,新增一条数据,注意字典名称要为:
`${you spi name}`。
-<img src="/static/img/shenyu/custom/custom-rate-limiter-zh.jpg" width="40%"
height="30%" />
+<img src="/img/shenyu/custom/custom-rate-limiter-zh.jpg" width="40%"
height="30%" />
* 或者执行以下自定义`SQL`语句:
diff --git
a/i18n/zh/docusaurus-plugin-content-docs/version-2.4.0/user-guide/property-config/gateway-property-config.md
b/i18n/zh/docusaurus-plugin-content-docs/version-2.4.0/user-guide/property-config/gateway-property-config.md
new file mode 100644
index 0000000..3842835
--- /dev/null
+++
b/i18n/zh/docusaurus-plugin-content-docs/version-2.4.0/user-guide/property-config/gateway-property-config.md
@@ -0,0 +1,230 @@
+---
+title: 网关属性配置
+keywords: ["配置"]
+description: 网关属性配置
+---
+
+本篇主要讲解如何在 `Apache Shenyu` 网关配置 `ShenYu` 的相关属性。
+
+<img src="/img/shenyu/config/shenyu_gateway_application_config.jpg"
width="80%" height="70%" />
+
+### 属性配置
+
+```yaml
+shenyu:
+# httpclient:
+# strategy: webClient
+# connectTimeout: 45000
+# readTimeout: 3000
+# writeTimeout: 3000
+# wiretap: false
+# pool:
+# type: ELASTIC
+# name: proxy
+# maxConnections: 16
+# acquireTimeout: 45000
+# proxy:
+# host:
+# port:
+# username:
+# password:
+# nonProxyHostsPattern:
+# ssl:
+# useInsecureTrustManager: false
+# trustedX509Certificates:
+# handshakeTimeout:
+# closeNotifyFlushTimeout:
+# closeNotifyReadTimeout:
+# defaultConfigurationType:
+ file:
+ enabled: true
+ cross:
+ enabled: true
+ exclude:
+ enabled: false
+ paths:
+ - /favicon.ico
+ sync:
+ websocket:
+ urls: ws://localhost:9095/websocket
+# zookeeper:
+# url: localhost:2181
+# sessionTimeout: 5000
+# connectionTimeout: 2000
+# http:
+# url: http://localhost:9095
+# nacos:
+# url: localhost:8848
+# namespace: 1c10d748-af86-43b9-8265-75f487d20c6c
+# username:
+# password:
+# acm:
+# enabled: false
+# endpoint: acm.aliyun.com
+# namespace:
+# accessKey:
+# secretKey:
+# etcd:
+# url: http://localhost:2379
+# consul:
+# url: http://localhost:8500
+# waitTime: 1000
+# watchDelay: 1000
+
+```
+
+### 属性详解
+
+##### shenyu.httpclient 配置
+
+这是 `ShenYu` 网关中代理Http及SpringCloud协议后,用于发送代理请求的HttpClient配置。
+
+| Name | Type | Default | Required | Description
|
+| :------------- | :-----: | :-----------: | :------: |
:----------------------------------------------------------- |
+| strategy | String | webcwebClient | No |
HttpClientPlugin实现策略(默认使用webClietn):<br />- `webClient`:使用WebClientPlugin<br
/>- `netty`:使用NettyHttpClientPlugin |
+| connectTimeout | int | 45000 | No | 连接超时时间 (毫秒),默认值为
`45000`. |
+| readTimeout | int | 3000 | No | 读取超时 (毫秒),默认值为 `3000`.
|
+| writeTimeout | int | 3000 | No | 输出超时
(millisecond),默认值为 `3000`. |
+| wiretap | Boolean | false | No | 启用 Netty HttpClient
的窃听调试,默认值为 `false`。 |
+| pool | | | | HttpClient连接池配置
|
+| proxy | | | | HttpClient代理配置
|
+| ssl | | | | HttpClient SSL配置
|
+
+- `pool` config
+
+HttpClient连接池配置:
+
+| Name | Type | Default | Required |
Description |
+| :------------- | :----: | :------------------------: | :------: |
:----------------------------------------------------------- |
+| type | String | ELASTIC | No |
HttpClient连接池类型,默认值为`ELASTIC`。<br /> - `ELASTIC`: 连接池可以按需缓存和增长。<br />- `FIXED`:
连接池缓存并重用,有固定的最大连接数。<br />- `DISABLED`: 连接池总是会创建一个新的连接。 |
+| name | String | proxy | No |
连接池映射名称,默认为`proxy`。 |
+| maxConnections | int | 2*可用处理器数,最小值为16 | No | 仅适用于 `FIXED`
类型,在现有连接上开始挂起获取之前的最大连接数。<br />默认值为可用处理器数*2。<br /> (最小值为 16) |
+| acquireTimeout | int | 45000 | No | 仅适用于
`FIXED` 类型,等待获取连接的最长时间(毫秒)。默认值为 45000 |
+
+- `Proxy` config
+
+Netty HttpClient 代理的相关配置:
+
+| Name | Type | Default | Required | Description
|
+| :------------------- | :----: | :-----: | :------: |
:---------------------------------- |
+| host | String | null | No | Netty HttpClient
代理配置的主机名。 |
+| port | String | null | No | Netty HttpClient
的代理配置端口。 |
+| username | String | null | No | Netty HttpClient
代理配置的用户名。 |
+| password | String | null | No | Netty HttpClient
代理配置的密码。 |
+| nonProxyHostsPattern | String | null | No | 直连的主机列表的正则表达式 (Java)。 |
+
+- `SSL` config
+
+网关路由可以同时支持路由到http和https的后端服务,以下为SSL相关配置:
+
+| Name | Type | Default | Required | Description
|
+| :----------------------- | :-----: | :-----: | :------: |
:----------------------------------------------------------- |
+| useInsecureTrustManager | Boolean | false | No |
是否信任所有下游证书,默认`false` |
+| trustedX509Certificates | Array | Null | No | 配置自己的信任的证书列表。
|
+| handshakeTimeout | int | 10000 | No |
SSL握手超时时间(毫秒),默认值为10000 |
+| closeNotifyFlushTimeout | int | 3000 | No | SSL close_notify
刷新超时(毫秒)默认值为 3000. |
+| closeNotifyReadTimeout | int | 0 | No | SSL close_notify
读取超时(毫秒)默认值为 0. |
+| defaultConfigurationType | String | TCP | No | SslContextBuilder
的默认配置, 默认为 TCP.<br />- H2: SslProvider 将根据
OpenSsl.isAlpnSupported()、SslProvider.HTTP2_CIPHERS、ALPN 支持、HTTP/1.1 和 HTTP/2
支持进行设置<br />- TCP: SslProvider 将根据 OpenSsl.isAvailable() 设置<br />- NONE:
不会有默认配置 |
+
+
+
+##### 过滤器相关配置
+
+- `shenyu.file` 配置
+
+文件过滤器的相关配置。
+
+| 名称 | 类型 | 默认值 | 是否必填 | 说明 |
+| :------ | :------ | :----: | :------: | :------------------- |
+| enabled | Boolean | false | 否 | 是否开启文件大小过滤 |
+
+
+
+- `shenyu.cross` 配置
+
+跨域相关配置。
+
+| 名称 | 类型 | 默认值 | 是否必填 | 说明 |
+| :------ | :------ | :----: | :------: | :--------------- |
+| enabled | Boolean | false | 否 | 是否支持跨域请求 |
+
+
+
+- `shenyu.exclude` 配置
+
+拒绝指定请求经过网关的相关配置
+
+| 名称 | 类型 | 默认值 | 是否必填 | 说明 |
+| :------ | :------ | :----: | :------: |
:----------------------------------------- |
+| enabled | Boolean | false | 否 | 是否拒绝指定请求经过网关 |
+| paths | Array | 无 | 是 | 匹配该列表的请求不经过网关(支持路径匹配) |
+
+
+
+##### shenyu.sync 配置
+
+网关和`Admin`端使用数据同步的相关配置。
+
+使用`websocket`进行数据同步的属性配置如下:
+
+| 名称 | 类型 | 默认值 | 是否必填 | 说明 |
+| :--- | :----- | :----: | :------: |
:------------------------------------------------- |
+| urls | String | 无 | 是 | `Admin`的websocket服务地址,多个地址用 `,` 分开 。 |
+
+
+
+使用`zookeeper`进行数据同步的属性配置如下:
+
+| 名称 | 类型 | 默认值 | 是否必填 | 说明 |
+| :---------------- | :----- | :----: | :------: | :--------------------------
|
+| url | String | 无 | 是 | `zookeeper`的连接地址 |
+| sessionTimeout | int | 无 | 是 | `session`的超时时间(毫秒) |
+| connectionTimeout | int | 无 | 是 | 连接超时时间(毫秒) |
+
+
+
+使用`http长轮询`进行数据同步的属性配置如下:
+
+| 名称 | 类型 | 默认值 | 是否必填 | 说明 |
+| :--- | :----- | :----: | :------: | :---------------- |
+| url | String | 无 | 是 | `Admin`的服务地址 |
+
+
+
+使用`nacos`进行数据同步的属性配置如下:
+
+| 名称 | 类型 | 默认值 | 是否必填 | 说明 |
+| :-------- | :----- | :----: | :------: | :---------------- |
+| url | String | 无 | 是 | `nacos`连接地址 |
+| namespace | String | 无 | 是 | 命名空间 |
+| username | String | 无 | 否 | 用户名 |
+| password | String | 无 | 否 | 密码 |
+| acm | | | 否 | 阿里云ACM服务配置 |
+
+- `acm`配置
+
+| 名称 | 类型 | 默认值 | 是否必填 | 说明 |
+| :-------- | :------ | :----: | :------: | :---------- |
+| enabled | boolean | false | 否 | 是否启用 |
+| endpoint | String | 无 | 是 | ACM服务地址 |
+| namespace | String | 无 | 否 | namespace |
+| accessKey | String | 无 | 否 | accessKey |
+| secretKey | String | 无 | 否 | secretKey |
+
+
+
+使用`etcd`进行数据同步的属性配置如下:
+
+| 名称 | 类型 | 默认值 | 是否必填 | 说明 |
+| :--- | :----- | :----: | :------: | :------------- |
+| url | String | 无 | 是 | `etcd`连接地址 |
+
+
+
+使用`consul`进行数据同步的属性配置如下:
+
+| 名称 | 类型 | 默认值 | 是否必填 | 说明 |
+| :--------- | :----- | :----: | :------: |
:------------------------------------------- |
+| url | String | 无 | 是 | `consul`连接地址
|
+| waitTime | int | 无 | 是 | 请求consul服务拉取配置信息的超时时间(毫秒) |
+| watchDelay | int | 无 | 是 | 同步间隔(毫秒)
|
diff --git a/static/img/shenyu/config/shenyu_gateway_application_config.jpg
b/static/img/shenyu/config/shenyu_gateway_application_config.jpg
new file mode 100644
index 0000000..a7752ed
Binary files /dev/null and
b/static/img/shenyu/config/shenyu_gateway_application_config.jpg differ
diff --git
a/versioned_docs/version-2.4.0/developer/spi/custom-condition-match.md
b/versioned_docs/version-2.4.0/developer/spi/custom-condition-match.md
index 0973fcc..a95c087 100644
--- a/versioned_docs/version-2.4.0/developer/spi/custom-condition-match.md
+++ b/versioned_docs/version-2.4.0/developer/spi/custom-condition-match.md
@@ -35,7 +35,7 @@ ${you spi name} = ${you class path}
* In the `Admin` service ---> BasicConfig ---> Dictionary , Find the
dictionary code as `MATCH_MODE`, add a new piece of data, pay attention to the
dictionary name: `${you spi name}`.
-<img src="/static/img/shenyu/custom/custom-condition-match-en.png" width="40%"
height="30%" />
+<img src="/img/shenyu/custom/custom-condition-match-en.png" width="40%"
height="30%" />
* Or execute the following custom `SQL` statement:
diff --git a/versioned_docs/version-2.4.0/developer/spi/custom-load-balance.md
b/versioned_docs/version-2.4.0/developer/spi/custom-load-balance.md
index 3f412ae..c5f13de 100644
--- a/versioned_docs/version-2.4.0/developer/spi/custom-load-balance.md
+++ b/versioned_docs/version-2.4.0/developer/spi/custom-load-balance.md
@@ -41,7 +41,7 @@ ${you spi name} = ${you class path}
* In the `Admin` service ---> BasicConfig ---> Dictionary , Find the
dictionary code as `LOAD_BALANCE`, add a new piece of data, pay attention to
the dictionary name: `${you spi name}`.
-<img src="/static/img/shenyu/custom/custom-load-balance-en.jpg" width="40%"
height="30%" />
+<img src="/img/shenyu/custom/custom-load-balance-en.jpg" width="40%"
height="30%" />
* Or execute the following custom `SQL` statement:
diff --git
a/versioned_docs/version-2.4.0/developer/spi/custom-metrics-monitor.md
b/versioned_docs/version-2.4.0/developer/spi/custom-metrics-monitor.md
index d02db1f..dc415dc 100644
--- a/versioned_docs/version-2.4.0/developer/spi/custom-metrics-monitor.md
+++ b/versioned_docs/version-2.4.0/developer/spi/custom-metrics-monitor.md
@@ -46,7 +46,7 @@ ${you spi name} = ${you class path}
* In the `Admin` service ---> BasicConfig ---> Plugin , Find the `Monitor`
plugin, edit config, pay attention to the `metricsName` name: `${you spi
name}`.
-<img src="/static/img/shenyu/custom/custom-metrics-monitor-en.jpg" width="40%"
height="30%" />
+<img src="/img/shenyu/custom/custom-metrics-monitor-en.jpg" width="40%"
height="30%" />
diff --git a/versioned_docs/version-2.4.0/developer/spi/custom-rate-limiter.md
b/versioned_docs/version-2.4.0/developer/spi/custom-rate-limiter.md
index ba0c21e..f064708 100644
--- a/versioned_docs/version-2.4.0/developer/spi/custom-rate-limiter.md
+++ b/versioned_docs/version-2.4.0/developer/spi/custom-rate-limiter.md
@@ -58,7 +58,7 @@ ${you spi name} = ${you class path}
* In the `Admin` service ---> BasicConfig ---> Dictionary , Find the
dictionary code as `ALGORITHM_*`, add a new piece of data, pay attention to the
dictionary name: `${you spi name}`.
-<img src="/static/img/shenyu/custom/custom-rate-limiter-en.jpg" width="40%"
height="30%" />
+<img src="/img/shenyu/custom/custom-rate-limiter-en.jpg" width="40%"
height="30%" />
* Or execute the following custom `SQL` statement:
diff --git
a/versioned_docs/version-2.4.0/user-guide/property-config/gateway-property-config.md
b/versioned_docs/version-2.4.0/user-guide/property-config/gateway-property-config.md
new file mode 100644
index 0000000..6420a97
--- /dev/null
+++
b/versioned_docs/version-2.4.0/user-guide/property-config/gateway-property-config.md
@@ -0,0 +1,234 @@
+---
+title: Gateway Property Config
+keywords: ["Config"]
+description: Gateway Property Config
+---
+
+This paper mainly explains how to configure `Apache ShenYu` properties on the
gateway side.
+
+<img src="/img/shenyu/config/shenyu_gateway_application_config.jpg"
width="80%" height="70%" />
+
+### Property Config
+
+```yaml
+shenyu:
+# httpclient:
+# strategy: webClient
+# connectTimeout: 45000
+# readTimeout: 3000
+# writeTimeout: 3000
+# wiretap: false
+# pool:
+# type: ELASTIC
+# name: proxy
+# maxConnections: 16
+# acquireTimeout: 45000
+# proxy:
+# host:
+# port:
+# username:
+# password:
+# nonProxyHostsPattern:
+# ssl:
+# useInsecureTrustManager: false
+# trustedX509Certificates:
+# handshakeTimeout:
+# closeNotifyFlushTimeout:
+# closeNotifyReadTimeout:
+# defaultConfigurationType:
+ file:
+ enabled: true
+ cross:
+ enabled: true
+ exclude:
+ enabled: false
+ paths:
+ - /favicon.ico
+ sync:
+ websocket:
+ urls: ws://localhost:9095/websocket
+# zookeeper:
+# url: localhost:2181
+# sessionTimeout: 5000
+# connectionTimeout: 2000
+# http:
+# url: http://localhost:9095
+# nacos:
+# url: localhost:8848
+# namespace: 1c10d748-af86-43b9-8265-75f487d20c6c
+# username:
+# password:
+# acm:
+# enabled: false
+# endpoint: acm.aliyun.com
+# namespace:
+# accessKey:
+# secretKey:
+# etcd:
+# url: http://localhost:2379
+# consul:
+# url: http://localhost:8500
+# waitTime: 1000
+# watchDelay: 1000
+```
+
+### Property Detail
+
+##### shenyu.httpclient config
+
+This is the HttpClient configuration used to send proxy requests after
proxying the Http and SpringCloud protocols in the `ShenYu` gateway.
+
+| Name | Type | Default | Required | Description
|
+| :------------- | :-----: | :-----------: | :------: |
:----------------------------------------------------------- |
+| strategy | String | webcwebClient | No | The strategy of
httpClientPlugin |
+| connectTimeout | int | 45000 | No | Connection timeout
(millisecond), the default value is 45000. |
+| readTimeout | int | 3000 | No | Read timeout
(millisecond), the default value is 3000. |
+| writeTimeout | int | 3000 | No | Write timeout
(millisecond), the default value is 3000. |
+| wiretap | Boolean | false | No | Enables wiretap
debugging for Netty HttpClient, the default value is `false`. |
+| pool | | | | HttpClient connection
pool config |
+| proxy | | | | HttpClient proxy
config |
+| ssl | | | | HttpClient ssl config
|
+
+- `pool` config
+
+HttpClient connection pool configuration:
+
+| Name | Type | Default | Required |
Description |
+| :------------- | :----: | :-------------------------------: | :------: |
:----------------------------------------------------------- |
+| type | String | ELASTIC | No |
Type of pool for HttpClient to use, defaults to ELASTIC.<br /> - ELASTIC: The
connection pool can be cached and grown on demand<br />- FIXED: The connection
pool cache and reuse a fixed maximum The number of connections.<br />-
DISABLED: The connection pool will always create a new connection. |
+| name | String | proxy | No | The
channel pool map name, defaults to proxy. |
+| maxConnections | int | the maximum value of 2*CPU and 16 | No |
Only for type FIXED, the maximum number of connections before starting pending
acquisition on existing ones.<br />the default value is available number of
processors*2. <br /> (but with a minimum value of 16) |
+| acquireTimeout | int | 45000 | No |
Only for type FIXED, the maximum time in millis to wait for aquiring. the
default value is 45000 |
+
+- `proxy` config
+
+Netty HttpClient proxy configuration:
+
+| Name | Type | Default | Required | Description
|
+| :------------------- | :----: | :-----: | :------: |
:----------------------------------------------------------- |
+| host | String | null | No | Hostname for proxy
configuration of Netty HttpClient. |
+| port | String | null | No | Port for proxy
configuration of Netty HttpClient. |
+| username | String | null | No | Username for proxy
configuration of Netty HttpClient. |
+| password | String | null | No | Password for proxy
configuration of Netty HttpClient. |
+| nonProxyHostsPattern | String | null | No | Regular expression
(Java) for a configured list of hosts. that should be reached directly,
bypassing the proxy |
+
+- `SSL` config
+
+Gateway routing can support routing to http and https back-end services at the
same time. The following is the SSL-related configuration:
+
+| Name | Type | Default | Required | Description
|
+| :----------------------- | :-----: | :-----: | :------: |
:----------------------------------------------------------- |
+| useInsecureTrustManager | Boolean | false | No | Installs the netty
InsecureTrustManagerFactory. This is insecure and not suitable for production. |
+| trustedX509Certificates | String | Null | No | Trusted
certificates for verifying the remote endpoint's certificate.(Use `,` to
separate multiple values) |
+| handshakeTimeout | int | 10000 | No | SSL handshake
timeout. Default to 10000 ms |
+| closeNotifyFlushTimeout | int | 3000 | No | SSL close_notify
flush timeout. Default to 3000 ms. |
+| closeNotifyReadTimeout | int | 0 | No | SSL close_notify
read timeout. Default to 0 ms. |
+| defaultConfigurationType | String | TCP | No | The default ssl
configuration type. Defaults to TCP.<br />- H2: SslProvider will be set
depending on OpenSsl.isAlpnSupported(), SslProvider.HTTP2_CIPHERS, ALPN
support, HTTP/1.1 and HTTP/2 support.<br />- TCP:
[`SslProvider`](https://netty.io/4.1/api/io/netty/handler/ssl/SslProvider.html?is-external=true)
will be set depending on `OpenSsl.isAvailable()`<br />- NONE: There will be no
default configuration |
+
+
+
+##### Filter Configuration
+
+- `shenyu.file` config
+
+File filter properties:
+
+|Name | Type | Default | Required | Description
|
+|:------------------------ |:----- |:-------:
|:-------:|:----------------------------|
+| enabled | Boolean | false | No | enable file size filtering |
+
+
+
+
+- `shenyu.cross` config
+
+Cross filter properties:
+
+
+|Name | Type | Default | Required | Description
|
+|:------------------------ |:----- |:-------:
|:-------:|:----------------------------|
+| enabled | Boolean | false | No | allow cross-domain requests |
+
+
+
+- `shenyu.exclude` config
+
+Exculde filter properties:
+
+|Name | Type | Default | Required | Description
|
+|:------------------------ |:----- |:-------:
|:-------:|:----------------------------|
+| enabled | Boolean | false | No | whether to enable `exclude filter`
and reject the specified request to pass through the gateway |
+| paths | Array | null | Yes | Requests matching this list can
not pass through the gateway (support Path-Matching) |
+
+
+
+##### shenyu.sync config
+
+The Apache ShenYu gateway and the Admin System use data synchronization
configurations.
+
+
+The following properties are configured for data synchronization using
`websocket` :
+
+|Name | Type | Default | Required | Description
|
+|:------------------------ |:----- |:-------:
|:-------:|:----------------------------|
+| urls | String | null | Yes | The websocket server address of
`Admin`, separate multiple addresses with `,` |
+
+
+
+The following properties are configured for data synchronization using
`zookeeper` :
+
+
+|Name | Type | Default | Required | Description
|
+|:------------------------ |:----- |:-------:
|:-------:|:----------------------------|
+|url | String | null | Yes |zookeeper server url|
+|sessionTimeout | int | null | Yes |session timeout
(millisecond)|
+|connectionTimeout | int | null | Yes |connection timeout
(millisecond)|
+
+
+
+The following properties are configured for data synchronization using `http
long polling` :
+
+|Name | Type | Default | Required | Description
|
+|:------------------------ |:----- |:-------:
|:-------:|:----------------------------|
+| url | String | null | Yes | `Admin` server address |
+
+
+
+The following properties are configured for data synchronization using `nacos`
:
+
+|Name | Type | Default | Required | Description
|
+|:------------------------ |:----- |:-------:
|:-------:|:----------------------------|
+|url | String | null | 是 |nacos url|
+|namespace | String | null | Yes |namespace|
+|username | String | null | No |username|
+|password | String | null | No |password|
+|acm | | | No |aliyun ACM service configuration|
+
+- `acm` config
+
+|Name | Type | Default | Required | Description
|
+|:------------------------ |:----- |:-------:
|:-------:|:----------------------------|
+|enabled | boolean | false | No |whether to enable|
+|endpoint | String | null | No |ACM service address|
+|namespace | String | null | No |namespace|
+|accessKey | String | null | No |accessKey|
+|secretKey | String | null | No |secretKey|
+
+
+
+The following properties are configured for data synchronization using `etcd` :
+
+|Name | Type | Default | Required | Description
|
+|:------------------------ |:----- |:-------:
|:-------:|:----------------------------|
+|url | String | null | Yes |`etcd` server url|
+
+
+
+The following properties are configured for data synchronization using
`consul` :
+
+|Name | Type | Default | Required | Description
|
+|:------------------------ |:----- |:-------:
|:-------:|:----------------------------|
+|url | String | null | Yes |`consul` server url|
+| waitTime | int | null | Yes | the timeout period for requesting
consul service to pull configuration information (milliseconds) |
+|watchDelay | int | null | Yes |Synchronization interval (milliseconds)|
+