mirror of
https://gitee.com/mirrors/Spring-Cloud-Alibaba.git
synced 2021-06-26 13:25:11 +08:00
update docs
This commit is contained in:
@@ -10,17 +10,15 @@ Easily navigate and move apps up at a cost close to “zero” costs. Dubbo Spri
|
||||
Since Dubbo Spring Cloud is built on top of the native Spring Cloud, its service governance capabilities are considered Spring Cloud Plus.
|
||||
Not only does it fully cover the Spring Cloud native features [5], but it also provides a more stable and mature implementation, as shown in the following table:
|
||||
|
||||
:frame: topbot
|
||||
[width="60%",options="header"]
|
||||
|====
|
||||
^|Feature ^|Spring Cloud ^|Dubbo Spring Cloud
|
||||
|===
|
||||
|Feature |Spring Cloud |Dubbo Spring Cloud
|
||||
| Distributed configuration | Git、Zookeeper、Consul、JDBC | Spring Cloud Distributed Configuration + Dubbo Configuration Center[6]
|
||||
| Service registration and discovery | Eureka、Zookeeper、Consul | Spring Cloud Native Registration Center[7] + Dubbo Native Registration Center[8]
|
||||
| Load balancing | Ribbon(Random, RoundRobin) | Dubbo built-in implementation (random, polling, etc. + weights, etc.)
|
||||
| Circuit Breakers | Spring Cloud Hystrix | Spring Cloud Hystrix + Alibaba Sentinel[9] etc.
|
||||
| Service-to-service calls | Open Feign、`RestTemplate` | Spring Cloud service call + Dubbo `@Reference`.
|
||||
| Tracing | Spring Cloud Sleuth[10] + Zipkin[11] | Zipkin、opentracing, etc.
|
||||
|====
|
||||
|===
|
||||
|
||||
=== Reference
|
||||
|
||||
|
@@ -401,10 +401,8 @@ set spring.cloud.nacos.config.enabled = false to disable Spring Cloud Nacos Conf
|
||||
|
||||
The following shows the other configurations of the starter of Nacos Config:
|
||||
|
||||
:frame: topbot
|
||||
[width="60%",options="header"]
|
||||
|====
|
||||
^|Configuration ^|Key ^|Default Value ^|Description
|
||||
|===
|
||||
|Configuration |Key |Default Value |Description
|
||||
|Server address|`spring.cloud.nacos.config.server-addr`|| IP and port of the Nacos Server listener
|
||||
|Dataid from nacos config|`spring.cloud.nacos.config.name`|| First take the prefix, then go to the name, and finally take spring.application.name
|
||||
|Dataid from nacos config|`spring.cloud.nacos.config.prefix`|| First take the prefix, then go to the name, and finally take spring.application.name
|
||||
@@ -421,4 +419,4 @@ The following shows the other configurations of the starter of Nacos Config:
|
||||
|Dataid for Shared Configuration|`spring.cloud.nacos.config.sharedDataids`||Dataid for Shared Configuration, split by ","
|
||||
|Dynamic refresh dataid for Shared Configuration|`spring.cloud.nacos.config.refreshableDataids`||Dynamic refresh dataid for Shared Configuration, split by ","
|
||||
|custom dataid|`spring.cloud.nacos.config.extConfig`||It's a List,build up by `Config` POJO. `Config` has 3 attributes, `dataId`, `group` and `refresh`
|
||||
|====
|
||||
|===
|
||||
|
@@ -41,10 +41,12 @@ For more Nacos Server versions, you can download the latest version from https:/
|
||||
|
||||
The following sample illustrates how to register a service to Nacos.
|
||||
|
||||
* Configuration of pom.xml The following is a complete example of pom.xml:
|
||||
[source, xml]
|
||||
* Configuration of pom.xml The following is a complete example of pom.xml:
|
||||
|
||||
.pom.xml
|
||||
[source,xml]
|
||||
----
|
||||
<?xml version="1.0" encoding="UTF-8"? >
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
@@ -115,7 +117,8 @@ The following sample illustrates how to register a service to Nacos.
|
||||
----
|
||||
|
||||
* Configuration of application.properties Some of the basic configurations of Nacos must be included in application.properties(or application.yaml), as shown below:
|
||||
application.properties
|
||||
|
||||
.application.properties
|
||||
[source,properties]
|
||||
----
|
||||
server.port=8081
|
||||
@@ -128,6 +131,7 @@ management.endpoints.web.exposure.include=*
|
||||
NOTE: If you do not want to use Nacos for service registration and discovery, you can set `spring.cloud.nacos.discovery` to `false`.
|
||||
|
||||
* The following is a sample for starting Provider:
|
||||
|
||||
[source,java,indent=0]
|
||||
----
|
||||
@SpringBootApplication
|
||||
@@ -294,10 +298,8 @@ The followings shows how a service instance accesses the Endpoint:
|
||||
|
||||
The following shows the other configurations of the starter of Nacos Discovery:
|
||||
|
||||
:frame: topbot
|
||||
[width="60%",options="header"]
|
||||
|====
|
||||
^|Configuration ^|Key ^|Default Value ^|Description
|
||||
|===
|
||||
|Configuration |Key |Default Value |Description
|
||||
|Server address|`spring.cloud.nacos.discovery.server-addr`||IP and port of the Nacos Server listener
|
||||
|Service name|`spring.cloud.nacos.discovery.service`|`${spring.application.name}`|Name the current service
|
||||
|Weight|`spring.cloud.nacos.discovery.weight`|`1`|Value range: 1 to 100. The bigger the value, the greater the weight
|
||||
@@ -313,5 +315,5 @@ The following shows the other configurations of the starter of Nacos Discovery:
|
||||
|Endpoint|`spring.cloud.nacos.discovery.endpoint`||The domain name of a certain service in a specific region. You can retrieve the server address dynamically with this domain name
|
||||
|Integrate Ribbon or not|`ribbon.nacos.enabled`|`true`|Set to true in most cases
|
||||
|Enable Nacos Watch|`spring.cloud.nacos.discovery.watch.enabled`|`true`|set to false to close watch
|
||||
|====
|
||||
|===
|
||||
|
||||
|
@@ -110,6 +110,7 @@ If there is conflict with the 8080 port, you can use `-Dserver.port=new port` to
|
||||
==== Configure the Dashboard
|
||||
|
||||
.application.yml
|
||||
[source,yaml]
|
||||
----
|
||||
spring:
|
||||
cloud:
|
||||
@@ -214,7 +215,8 @@ NOTE: Take Http GET `https://www.taobao.com/test` as an example. The correspondi
|
||||
|
||||
For example, 4 data sources are configures:
|
||||
|
||||
```
|
||||
[source,properties]
|
||||
----
|
||||
spring.cloud.sentinel.datasource.ds1.file.file=classpath: degraderule.json
|
||||
spring.cloud.sentinel.datasource.ds1.file.rule-type=flow
|
||||
|
||||
@@ -237,7 +239,7 @@ spring.cloud.sentinel.datasource.ds4.apollo.namespace-name = application
|
||||
spring.cloud.sentinel.datasource.ds4.apollo.flow-rules-key = sentinel
|
||||
spring.cloud.sentinel.datasource.ds4.apollo.default-flow-rule-value = test
|
||||
spring.cloud.sentinel.datasource.ds4.apollo.rule-type=param-flow
|
||||
```
|
||||
----
|
||||
|
||||
This method follows the configuration of Spring Cloud Stream Binder. `TreeMap` is used for storage internally, and comparator is `String.CASE_INSENSITIVE_ORDER`.
|
||||
|
||||
@@ -408,21 +410,17 @@ The followings shows how a service instance accesses the Endpoint:
|
||||
|
||||
The following table shows that when there are corresponding bean types in `ApplicationContext`, some actions will be taken:
|
||||
|
||||
:frame: topbot
|
||||
[width="60%",options="header"]
|
||||
|====
|
||||
^|Existing Bean Type ^|Action ^|Function
|
||||
|===
|
||||
|Existing Bean Type |Action |Function
|
||||
|`UrlCleaner`|`WebCallbackManager.setUrlCleaner(urlCleaner)`|Resource cleaning(resource(for example, classify all URLs of /foo/:id to the /foo/* resource))
|
||||
|`UrlBlockHandler`|`WebCallbackManager.setUrlBlockHandler(urlBlockHandler)`|Customize rate limiting logic
|
||||
|`RequestOriginParser`|`WebCallbackManager.setRequestOriginParser(requestOriginParser)`|Setting the origin
|
||||
|====
|
||||
|===
|
||||
|
||||
The following table shows all the configurations of Spring Cloud Alibaba Sentinel:
|
||||
|
||||
:frame: topbot
|
||||
[width="60%",options="header"]
|
||||
|====
|
||||
^|Configuration ^|Description ^|Default Value
|
||||
|===
|
||||
|Configuration |Description |Default Value
|
||||
|`spring.application.name` or `project.name`|Project Name Of Sentinel|
|
||||
|`spring.cloud.sentinel.enabled`|Whether Sentinel automatic configuration takes effect|true
|
||||
|`spring.cloud.sentinel.eager`|Whether to trigger Sentinel initialization in advance|false
|
||||
@@ -448,7 +446,7 @@ The following table shows all the configurations of Spring Cloud Alibaba Sentine
|
||||
|`spring.cloud.sentinel.scg.fallback.response-body`| Spring Cloud Gateway response mode is response content corresponding to 'response' mode |
|
||||
|`spring.cloud.sentinel.scg.fallback.response-status`| Spring Cloud Gateway response mode is the response code corresponding to 'response' mode | 429
|
||||
|`spring.cloud.sentinel.scg.fallback.content-type`| The Spring Cloud Gateway response mode is the content-type corresponding to the 'response' mode. | application/json
|
||||
|====
|
||||
|===
|
||||
|
||||
|
||||
NOTE: These configurations will only take effect in servlet environment. RestTemplate and Feign will not take effect for these configurations.
|
||||
|
@@ -185,6 +185,7 @@ By subscribing to the SmsUp upstream SMS message, you can know the content of th
|
||||
1、Configure the queue name for SmsReport in the `application.properties` configuration file (which can also be application.yaml).
|
||||
|
||||
.application.properties
|
||||
[source,properties]
|
||||
----
|
||||
spring.cloud.alicloud.sms.up-queue-name=Alicom-Queue-********-SmsUp
|
||||
----
|
||||
|
Reference in New Issue
Block a user