apollo doc (#909)
* client-config-apollo
* client-config-apollo
* register-access
* apollo
diff --git a/docs/user-guide/property-config/admin-property-config.md b/docs/user-guide/property-config/admin-property-config.md
index 5e7df51..f3dd630 100644
--- a/docs/user-guide/property-config/admin-property-config.md
+++ b/docs/user-guide/property-config/admin-property-config.md
@@ -141,6 +141,17 @@
|metadata-path | String | `shenyu/register` | No |Metadata path name, default is `shenyu/register`.|
+When the registerType is `apollo`, the supported properties are as follows.
+
+| Name | Type | Default | Required | Description |
+|:--------------|:-------|:-------:|:--------:|:---------------------|
+| appId | String | null | Yes | Apollo appId |
+| namespace | String | null | Yes | Apollo namespace |
+| portalUrl | String | null | Yes | Apollo portalUrl |
+| env | String | null | Yes | Apollo env |
+| clusterName | String | null | Yes | Apollo clusterName |
+| token | String | null | Yes | Apollo token |
+
##### shenyu.sync config
diff --git a/docs/user-guide/property-config/client-property-config.md b/docs/user-guide/property-config/client-property-config.md
index 35b053f..be863f0 100644
--- a/docs/user-guide/property-config/client-property-config.md
+++ b/docs/user-guide/property-config/client-property-config.md
@@ -16,8 +16,8 @@
```yaml
shenyu:
client:
- registerType: http #zookeeper #etcd #nacos #consul
- serverLists: http://localhost:9095 #localhost:2181 #http://localhost:2379 #localhost:8848
+ registerType: http #zookeeper #etcd #nacos #consul #apollo
+ serverLists: http://localhost:9095 #localhost:2181 #http://localhost:2379 #localhost:8848 #localhost:8080
props:
contextPath: /http
appName: http
@@ -34,11 +34,11 @@
-|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.|
+| Name | Type | Default | Required | Description |
+|:-------------|:-------|:-------:|:--------:|:----------------------------------------------------------------------------------------------------------|
+| registerType | String | http | Yes | Which mode to use for registry. Currently, http, zookeeper, etcd, consul ,apollo 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. |
@@ -92,5 +92,15 @@
|accessKey | String | "" | No |accessKey|
|secretKey | String | "" | No |secretKey|
+When the registerType is `apollo`, the supported properties are as follows.
+
+| Name | Type | Default | Required | Description |
+|:------------|:-------|:--------:|:--------:|:------------|
+| appId | String | "shenyu" | Yes | appId |
+| env | String | "" | Yes | env |
+| clusterName | String | "" | Yes | clusterName |
+| namespace | String | "" | Yes | namespace |
+| token | String | "" | Yes | token |
+| portalUrl | String | "" | Yes | portalUrl |
When the registerType is `consul`, no other property configuration is provided. please set `spring.cloud.consul` for the configuration.
diff --git a/docs/user-guide/property-config/gateway-property-config.md b/docs/user-guide/property-config/gateway-property-config.md
index c207a1f..e5970ae 100644
--- a/docs/user-guide/property-config/gateway-property-config.md
+++ b/docs/user-guide/property-config/gateway-property-config.md
@@ -492,19 +492,31 @@
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 | | Object | - | No |aliyun ACM service configuration.|
-| |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.|
+|Name | | Type | Default | Required | Description |
+|:------------------------ |:----- |:-------: |:-------:|:---------|:---------------------------:|
+|url | | String | null | Yes |nacos url|
+|namespace | | String | null | Yes |namespace|
+|username | | String | null | No |username|
+|password | | String | null | No |password|
+|acm | | Object | - | No |aliyun ACM service configuration.|
+| |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 `apollo` :
+
+| Name | | Type | Default | Required | Description |
+|:------------|:----|:------:|:-------:|:---------|:-----------:|
+| namespace | | String | null | Yes | namespace |
+| appId | | String | null | Yes | appId |
+| token | | String | null | Yes | token |
+| clusterName | | String | default | Yes | cluster |
+| portalUrl | | String | null | Yes | portalUrl |
+| meta | | String | null | Yes | meta |
+| env | | String | null | Yes | env |
+
The following properties are configured for data synchronization using `etcd` :
diff --git a/docs/user-guide/property-config/register-center-access.md b/docs/user-guide/property-config/register-center-access.md
index af4a161..9ba392e 100644
--- a/docs/user-guide/property-config/register-center-access.md
+++ b/docs/user-guide/property-config/register-center-access.md
@@ -444,7 +444,97 @@
# nacosNameSpace: nacos namespace
```
+### Apollo Registry Config
+
+#### shenyu-admin config
+
+First add the related dependencies to the `pom` file (already added by default) :
+
+```xml
+ <dependency>
+ <groupId>org.apache.shenyu</groupId>
+ <artifactId>shenyu-register-server-apollo</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+```
+
+<img src="/img/shenyu/register/register-apollo-admin-pom.png" width="70%" height="60%" />
-In conclusion, this paper mainly describes how to connect your microservices (currently supporting `Http`, `Dubbo`, `Spring Cloud`, `gRPC`, `Motan`, `Sofa`, `Tars` and other protocols) to the `Apache ShenYu` gateway. the Apache ShenYu gateway support registry has `Http`, `Zookeeper`, `Etcd`, `Consul`, `Nacos` and so on. This paper introduces the different ways to register configuration information when `Http` service is used as the client to access `Apache ShenYu` gateway.
+* Then in the `yml` file, configure the registry as `apollo`, fill in the related `apollo` service address and parameters, and `apollo` namespace (need to be consistent with `shenyu-client`), the configuration information is as follows:
+
+
+```yaml
+shenyu:
+ register:
+ registerType: apollo #etcd #consul
+ serverLists: http://localhost:8080 #http://localhost:2379 #localhost:8848
+ props:
+ env: dev
+ appId: shenyu
+ namespaceName: application
+ clusterName: default
+ token: 0fff5645fc74ee5e0d63a6389433c8c8afc0beea31eed0279ecc1c8961d12da9
+ portalUrl: http://localhost:8070
+```
+
+<img src="/img/shenyu/register/register-apollo-admin-yml.png" width="70%" height="60%" />
+
+
+#### shenyu-client config
+
+The following shows the configuration information registered by `apollo` when the `Http` service accesses the `Apache ShenYu` gateway as a client. Other clients (such as `Dubbo` and `Spring Cloud`) can be configured in the same way.
+
+
+* First add dependencies to the `pom` file:
+
+```xml
+ <dependency>
+ <groupId>org.apache.shenyu</groupId>
+ <artifactId>shenyu-register-client-apollo</artifactId>
+ <version>${shenyu.version}</version>
+ </dependency>
+```
+
+<img src="/img/shenyu/register/register-apollo-client-pom.png" width="70%" height="60%" />
+
+
+* Then in `yml` configure registration mode as `apollo`, and fill in `apollo` service address and related parameters, also need `apollo` namespace (need to be consistent with `shenyu-admin`), IP (optional, then automatically obtain the local IP address) and port, configuration information is as follows:
+
+```yaml
+shenyu:
+ register:
+ registerType: apollo #etcd #consul
+ serverLists: http://localhost:8080 #http://localhost:2379 #localhost:8848
+ props:
+ env: dev
+ appId: shenyu
+ namespace: application
+ clusterName: default
+ token: 0fff5645fc74ee5e0d63a6389433c8c8afc0beea31eed0279ecc1c8961d12da9
+ portalUrl: http://localhost:8070
+ client:
+ http:
+ props:
+ contextPath: /http
+ appName: http
+ port: 8188
+ isFull: false
+# registerType : register type, set apollo
+# serverList: when register type is apollo, add apollo address list
+# env: apollo namespace
+# appId: apollo appId
+# namespaceName: apollo namespaceName
+# clusterName: apollo clusterName
+# token: apollo opeanapi token
+# portalUrl: apollo opeanapi portalUrl like http://localhost:8070
+# port: your project port number; apply to springmvc/tars/grpc
+# contextPath: your project's route prefix through shenyu gateway, such as /order ,/product etc,gateway will route based on it.
+# appName:your project name,the default value is`spring.application.name`.
+# isFull: set true means providing proxy for your entire service, or only a few controller. apply to springmvc/springcloud
+
+```
+
+
+In conclusion, this paper mainly describes how to connect your microservices (currently supporting `Http`, `Dubbo`, `Spring Cloud`, `gRPC`, `Motan`, `Sofa`, `Tars` and other protocols) to the `Apache ShenYu` gateway. the Apache ShenYu gateway support registry has `Http`, `Zookeeper`, `Etcd`, `Consul`, `Nacos`, `Apollo` and so on. This paper introduces the different ways to register configuration information when `Http` service is used as the client to access `Apache ShenYu` gateway.
diff --git a/docs/user-guide/property-config/register-center-instance.md b/docs/user-guide/property-config/register-center-instance.md
index cf81a67..cc2c063 100644
--- a/docs/user-guide/property-config/register-center-instance.md
+++ b/docs/user-guide/property-config/register-center-instance.md
@@ -50,18 +50,23 @@
etcdTTL: 5 #Optional, default 5
```
-### Use consul
+### Use apollo
Add the following configuration to the gateway's `yml` file:
```yaml
instance:
enabled: true
- registerType: consul
- serverLists: localhost:8848 #config with your consul address, used by the cluster environment, separated with (,).
+ registerType: apollo
+ serverLists: http://localhost:8080
props:
- consulTimeout: 3000 #Optional, default 3000
- consulTTL: 3000 #Optional, default 3000
+ env: dev
+ appId: shenyu
+ namespace: application
+ clusterName: default
+ token: 0fff5645fc74ee5e0d63a6389433c8c8afc0beea31eed0279ecc1c8961d12da9
+ portalUrl: http://localhost:8070
```
+
> After the configuration is complete, start the gateway and it will successfully register to the corresponding registration center.
diff --git a/docs/user-guide/property-config/use-data-sync.md b/docs/user-guide/property-config/use-data-sync.md
index 19bc227..cae7b15 100644
--- a/docs/user-guide/property-config/use-data-sync.md
+++ b/docs/user-guide/property-config/use-data-sync.md
@@ -331,6 +331,39 @@
<img src="/img/shenyu/dataSync/shenyu_consul_admin_sync_config.jpg" width="80%" height="70%" />
+### Apollo Synchronization Config
+
+* `Apache ShenYu` gateway config
+
+Add these dependencies in `pom.xml`:
+
+```xml
+<!-- apache shenyu data sync start use consul-->
+<dependency>
+ <groupId>org.apache.shenyu</groupId>
+ <artifactId>shenyu-spring-boot-starter-sync-data-apollo</artifactId>
+ <version>${project.version}</version>
+</dependency>
+```
+
+ <img src="/img/shenyu/dataSync/shenyu-data-sync-apollo-pom.png" width="80%" height="70%" />
+
+Add these config values in yaml file:
+
+```yaml
+shenyu:
+ sync:
+ apollo:
+ meta: http://localhost:8080
+ appId: shenyu
+ portalUrl: http://localhost:8070
+ env: dev
+ clusterName: test
+ namespace: application
+ token: 0fff5645fc74ee5e0d63a6389433c8c8afc0beea31eed0279ecc1c8961d12da9
+```
+
+ <img src="/img/shenyu/dataSync/shenyu-data-sync-admin-apollo-yml.png" width="80%" height="70%" />
> After the data synchronization strategy of Apache ShenYu gateway and shenyu-admin is reconfigured, the microservice needs to be restarted.
diff --git a/static/img/shenyu/dataSync/shenyu-data-sync-admin-apollo-yml.png b/static/img/shenyu/dataSync/shenyu-data-sync-admin-apollo-yml.png
new file mode 100644
index 0000000..da0efe7
--- /dev/null
+++ b/static/img/shenyu/dataSync/shenyu-data-sync-admin-apollo-yml.png
Binary files differ
diff --git a/static/img/shenyu/dataSync/shenyu-data-sync-apollo-pom.png b/static/img/shenyu/dataSync/shenyu-data-sync-apollo-pom.png
new file mode 100644
index 0000000..963df1b
--- /dev/null
+++ b/static/img/shenyu/dataSync/shenyu-data-sync-apollo-pom.png
Binary files differ
diff --git a/static/img/shenyu/register/register-apollo-admin-pom.png b/static/img/shenyu/register/register-apollo-admin-pom.png
new file mode 100644
index 0000000..2b18ce5
--- /dev/null
+++ b/static/img/shenyu/register/register-apollo-admin-pom.png
Binary files differ
diff --git a/static/img/shenyu/register/register-apollo-admin-yml.png b/static/img/shenyu/register/register-apollo-admin-yml.png
new file mode 100644
index 0000000..cc53754
--- /dev/null
+++ b/static/img/shenyu/register/register-apollo-admin-yml.png
Binary files differ
diff --git a/static/img/shenyu/register/register-apollo-client-pom.png b/static/img/shenyu/register/register-apollo-client-pom.png
new file mode 100644
index 0000000..6c977fb
--- /dev/null
+++ b/static/img/shenyu/register/register-apollo-client-pom.png
Binary files differ
diff --git a/static/img/shenyu/register/register-apollo-client-yml.png b/static/img/shenyu/register/register-apollo-client-yml.png
new file mode 100644
index 0000000..33d831a
--- /dev/null
+++ b/static/img/shenyu/register/register-apollo-client-yml.png
Binary files differ