docs:update docs

pull/15/head
SkyeBeFreeman 3 years ago
parent 73793a506c
commit de863e37c0

@ -6,16 +6,17 @@
## 介绍
Spring Cloud Tencent包含了分布式应用微服务开发过程中所需的组件基于 Spring Cloud 框架的开发者可以使用这些组件快速进行分布式应用的开发
Spring Cloud Tencent包含了分布式应用微服务开发过程中所需的组件基于 Spring Cloud 框架的开发者可以使用这些组件快速进行分布式应用的开发
在Spring Cloud Tencent的基础上您只需要添加少量配置就可以将 Spring Cloud 应用接入腾讯云微服务解决方案,通过腾讯云中间件来迅速搭建分布式应用系统。
## 主要功能
* **服务注册与发现**:基于 Spring Cloud Common的标准进行微服务的注册与发现
* **服务路由与负载均衡**:基于 Ribbon 的接口标准,提供场景更丰富的动态路由以及负载均衡的能力
* **故障节点熔断**:提供故障节点的熔断剔除以及主/被动探测恢复的能力,保证分布式服务的可靠性
* **服务限流**:支持工作于微服务被调接入层的限流功能,保证后台微服务稳定性,可通过控制台动态配置规则,及查看流量监控数据
* **服务注册与发现**:基于 Spring Cloud Common的标准进行微服务的注册与发现。
* **服务路由与负载均衡**:基于 Ribbon 的接口标准,提供场景更丰富的动态路由以及负载均衡的能力。
* **故障节点熔断**:提供故障节点的熔断剔除以及主/被动探测恢复的能力,保证分布式服务的可靠性。
* **服务限流**:支持工作于微服务被调接入层的限流功能,保证后台微服务稳定性,可通过控制台动态配置规则,及查看流量监控数据。
* **元数据传递**:支持网关和微服务之间的元数据传递。
## 组件
@ -58,11 +59,13 @@ Spring Cloud Tencent 项目包含了一个子模块spring-cloud-tencent-examples
Example 列表:
- [Polaris Discovery Example](spring-cloud-tencent-examples/polaris-discovery-example/README.md)
- [Polaris Discovery Example](spring-cloud-tencent-examples/polaris-discovery-example/README-zh.md)
- [Polaris CircuitBreaker Example](spring-cloud-tencent-examples/polaris-circuitbreaker-example/README.md)
- [Polaris CircuitBreaker Example](spring-cloud-tencent-examples/polaris-circuitbreaker-example/README-zh.md)
- [Polaris RateLimit Example](spring-cloud-tencent-examples/polaris-ratelimit-example/README.md)
- [Polaris RateLimit Example](spring-cloud-tencent-examples/polaris-ratelimit-example/README-zh.md)
-
- [Polaris Gateway Example](spring-cloud-tencent-examples/polaris-gateway-example/README-zh.md)
## 版本号规范

@ -13,10 +13,11 @@ Based on Spring Cloud Tencent, you only need a small configuration to launch Spr
## Key Features
* **Service Registration and Discovery**Based on Spring Cloud's discovery and registration standard.
* **Service Routing and LoadBalancer**Based on ribbon's API port, provide dynamic routing and load balancing use cases.
* **CircuitBreaker Node**Support circuitbreak's auto-reset ability, ensure the reliability of distributed server
* **Rate Limiter**Support rate limit between microservice and access layer, ensure the stability of backend, one can configure policies and traffic data from the control panel
* **Service Registration and Discovery**: Based on Spring Cloud's discovery and registration standard.
* **Service Routing and LoadBalancer**: Based on ribbon's API port, provide dynamic routing and load balancing use cases.
* **CircuitBreaker Node**: Support circuitbreak's auto-reset ability, ensure the reliability of distributed server
* **Rate Limiter**: Support rate limit between microservice and access layer, ensure the stability of backend, one can configure policies and traffic data from the control panel
* **Metadata Delivery**: Support metadata delivery between gateways and microservices.
## Components
@ -67,6 +68,8 @@ Example List:
- [Polaris RateLimit Example](spring-cloud-tencent-examples/polaris-ratelimit-example/README.md)
- [Polaris Gateway Example](spring-cloud-tencent-examples/polaris-gateway-example/README.md)
### Version Standard
We use a version policy related to Spring Cloud's major version number.

@ -17,12 +17,12 @@ Cloud项目对接服务治理平台[Polaris](https://github.com/polarismesh)的
- 连续故障熔断当实例在上一个时间窗默认1分钟连续失败的请求数达到或者超过连续故障阈值默认10个实例会进入隔离状态。
- 熔断隔离时间默认隔离30s支持可配置。
相关配置请参考[Polaris故障熔断相关文档](https://github.com/polarismesh)
相关配置请参考[PolarisJava使用文档](https://github.com/PolarisMesh/polaris-java)
## 快速入门
本章节将介绍如何最简单地在Spring Cloud项目中使用Polaris
CircuitBreaker的功能。启动微服务之前需要启动Polaris具体启动方式参考[Polaris](https://github.com/polarismesh)。
CircuitBreaker的功能。启动微服务之前需要启动Polaris具体启动方式参考[Polaris Getting Started](https://github.com/PolarisMesh/polaris#getting-started)。
1. 您可以在项目中加入```spring-cloud-starter-tencent-polaris-circuitbreaker```依赖即可使用故障熔断的特性。如Maven项目中在pom中添加如下配置

@ -3,7 +3,7 @@
## 模块简介
```spring-cloud-starter-tencent-polaris-discovery```是用于Spring
Cloud项目对接服务治理平台[Polaris](https://github.com/polarismesh)的服务发现模块。您可以通过引入依赖即可完成微服务注册到服务治理平台Polaris获得对整个微服务架构的服务治理能力。
Cloud项目对接服务治理平台[Polaris](https://github.com/PolarisMesh/polaris)的服务发现模块。您可以通过引入依赖即可完成微服务注册到服务治理平台Polaris获得对整个微服务架构的服务治理能力。
## 功能介绍
@ -24,7 +24,7 @@ Cloud项目对接服务治理平台[Polaris](https://github.com/polarismesh)的
## 快速入门
本章节将介绍如何最简单地在Spring Cloud项目中使用Polaris
Discovery的功能。启动微服务之前需要启动Polaris具体启动方式参考[Polaris](https://github.com/polarismesh)。
Discovery的功能。启动微服务之前需要启动Polaris具体启动方式参考[Polaris Getting Started](https://github.com/PolarisMesh/polaris#getting-started)。
1. 您可以在项目中加入```spring-cloud-starter-tencent-polaris-discovery```依赖即可使用Polaris的服务注册与发现功能。如Maven项目中在pom中添加如下配置

@ -0,0 +1,35 @@
# Spring Cloud Tencent Polaris Gateway
## 模块简介
```spring-cloud-tencent-polaris-gateway```是用于Spring Cloud项目对接服务治理平台[Polaris](https://github.com/PolarisMesh/polaris)的微服务网关模块。
您可以通过引入依赖即可使用Polaris拓展的微服务网关功能。
## 功能介绍
### 元数据传递
支持网关和微服务之间的元数据传递。
## 快速入门
本章节将介绍如何最简单地在Spring Cloud项目中使用Spring Cloud Tencent Polaris Gateway的功能。
启动微服务之前需要启动Polaris具体启动方式参考[Polaris Getting Started](https://github.com/PolarisMesh/polaris#getting-started)。
1. 您可以在项目中加入```spring-cloud-tencent-polaris-gateway```依赖即可使用Polaris的微服务网关拓展功能意味着您还是需要自行添加微服务网关模块如zuul、spring-cloud-gateway。如Maven项目中在pom中添加如下配置
```XML
<dependency>
<groupId>com.tencent.cloud</groupId>
<artifactId>spring-cloud-tencent-polaris-gateway</artifactId>
</dependency>
```
2. 更加详细的使用方法参考 [Polaris Gateway Example](../../../../spring-cloud-tencent-examples/polaris-gateway-example/README-zh.md)。
## 功能使用
### 元数据传递
其依赖的是```spring-cloud-tencent-metadata```模块的功能,因此使用上参考[Spring Cloud Tencent Metadata](spring-cloud-tencent-metadata.md)即可。

@ -3,7 +3,7 @@
## 模块简介
```spring-cloud-starter-tencent-polaris-ratelimit```是用于Spring
Cloud项目对接服务治理平台[Polaris](https://github.com/polarismesh)的服务限流模块。
Cloud项目对接服务治理平台[Polaris](https://github.com/PolarisMesh/polaris)的服务限流模块。
您可以通过引入依赖即可获得对微服务架构的服务限流能力。建议与```spring-cloud-starter-tencent-polaris-discovery```配合使用。
## 功能介绍
@ -23,7 +23,7 @@ Cloud项目对接服务治理平台[Polaris](https://github.com/polarismesh)的
## 快速入门
本章节将介绍如何最简单地在Spring Cloud项目中使用Polaris
RateLimit的功能。启动微服务之前需要启动Polaris具体启动方式参考[Polaris](https://github.com/polarismesh)。
RateLimit的功能。启动微服务之前需要启动Polaris具体启动方式参考[Polaris Getting Started](https://github.com/PolarisMesh/polaris#getting-started)。
1. 您可以在项目中加入```spring-cloud-starter-tencent-polaris-ratelimit```依赖即可使用服务限流的特性。如Maven项目中在pom中添加如下配置
@ -36,7 +36,7 @@ RateLimit的功能。启动微服务之前需要启动Polaris具体启动
2. 添加限流规则配置
北极星提供了三种添加限流配置的方式包括控制台操作、HTTP接口上传和本地文件配置具体请参考[北极星服务限流使用文档](https://github.com/polarismesh)
北极星提供了三种添加限流配置的方式包括控制台操作、HTTP接口上传和本地文件配置具体请参考[北极星Java使用文档](https://github.com/PolarisMesh/polaris-java)
更加详细的使用方法参考 [Polaris RateLimit Example](../../../../spring-cloud-tencent-examples/polaris-ratelimit-example/README-zh.md)。

@ -1,6 +1,6 @@
# Polaris CircuitBreaker
# Spring Cloud Starter Tencent Polaris CircuitBreaker
## Module Intro
## Module Introduction
```spring-cloud-starter-tencent-polaris-circuitbreaker```is applied to Spring
Cloud project joint with [Polaris](https://github.com/polarismesh)'s CircuitBreaker module you can get cloud service engine's rate limit ability by introducing dependency. Recommended using with ```spring-cloud-starter-tencent-polaris-discovery```.
@ -22,7 +22,7 @@ For configuration, please refer to [Polaris CircuitBreaker](https://github.com/p
## User Guide
This chapter will explain how to use Polaris in Spring Cloud project in the simplest way.
CircuitBreaker's feature. Before starting MicroService, one needs to activate Polaris, activation details please refer to [Polaris](https://github.com/polarismesh).
CircuitBreaker's feature. Before starting MicroService, one needs to launch Polaris. Please refer to [Polaris Getting Started](https://github.com/PolarisMesh/polaris#getting-started).
1. you can add ```spring-cloud-starter-tencent-polaris-circuitbreaker``` 's dependencies in your project to use CircuitBreaker features. For example, in Maven's project, add listed configurations in pom:

@ -1,6 +1,6 @@
# Polaris Discovery
# Spring Cloud Starter Tencent Polaris Discovery
## Module Intro
## Module Introduction
```spring-cloud-starter-tencent-polaris-discovery``` is used in Spring Cloud project joint with [Polaris](https://github.com/polarismesh)'s Polaris Discovery component. You can complete Microservice registration at Polaris through dependencies, get visibility and control to the entire Cloud Service Engine.
@ -22,7 +22,7 @@ CLB supports qualified packet forwarding in the service instance. Through set ba
## User Guide
This chapter will explain how to use Polaris Discovery's features in the Spring Cloud project. Before starting MicroService, one needs to activate Polaris, activation details please refer to [Polaris](https://github.com/polarismesh).
This chapter will explain how to use Polaris Discovery's features in the Spring Cloud project. Before starting MicroService, one needs to launch Polaris. Please refer to [Polaris Getting Started](https://github.com/PolarisMesh/polaris#getting-started).
1. you can add ```spring-cloud-starter-tencent-polaris-discovery```'s 's dependencies in your project to use Polaris's service registration and discovery feature. For example, in Maven's project, add listed configurations in pom:

@ -0,0 +1,32 @@
# Spring Cloud Tencent Polaris Gateway
## Module Introduction
```spring-cloud-tencent-polaris-gateway``` is used in Spring Cloud project joint with
[Polaris](https://github.com/PolarisMesh/polaris)'s Polaris Gateway component.
You can use Polaris's extension microservice gateway features by importing dependency.
## Features Instruction
### Metadata Delivery
Support metadata delivery between gateways and microservices.
## User Guide
This chapter will explain how to use Spring Cloud Tencent Polaris Gateway's features in the Spring Cloud project.
Before starting MicroService, one needs to launch Polaris.
Please refer to [Polaris Getting Started](https://github.com/PolarisMesh/polaris#getting-started).
1. you can add ```spring-cloud-tencent-polaris-gateway``` in your project to use Polaris's microservice gateway extension features
(meaning you still need to add microservice gateway modules yourself, such as zuul, spring-cloud-gateway).
For example, in Maven's project, add listed configurations in pom:
```XML
<dependency>
<groupId>com.tencent.cloud</groupId>
<artifactId>spring-cloud-tencent-polaris-gateway</artifactId>
</dependency>
```
2. For further instructions, please refer to [Polaris Gateway Example](../../../../spring-cloud-tencent-examples/polaris-gateway-example/README.md)。.

@ -1,4 +1,4 @@
# Polaris RateLimit
# Spring Cloud Starter Tencent Polaris RateLimit
## Module Introduction
@ -22,7 +22,7 @@ Default introduce spring-cloud-starter-tencent-polaris-ratelimit dependencies ca
## User Guide
This chapter will explain how to use Polaris RateLimit in Spring Cloud project with the easiest way. Before starting MicroService, one needs to activate Polaris, activation details please refer to [Polaris](https://github.com/polarismesh).
This chapter will explain how to use Polaris RateLimit in Spring Cloud project with the easiest way. Before starting MicroService, one needs to launch Polaris. Please refer to [Polaris Getting Started](https://github.com/PolarisMesh/polaris#getting-started).
1. you can add ```spring-cloud-starter-tencent-polaris-ratelimit```s dependencies in your project to use the rate limit feature. For example, in Maven's project, add listed:

@ -10,7 +10,7 @@
### 修改配置
在两个微服务的```src/main/resources```下的```bootstrap.yml```文件中添加如下配置。其中,${ip}和${port}为Polaris后端服务的IP地址与端口号。
配置如下所示。其中,${ip}和${port}为Polaris后端服务的IP地址与端口号。
```yaml
spring:
@ -18,14 +18,14 @@ spring:
name: ${application.name}
cloud:
polaris:
server-addr: ${ip}:${port}
address: ${ip}:${port}
```
### 启动样例
#### 启动Polaris后端服务
参考[Polaris](https://github.com/polarismesh)。
参考[Polaris Getting Started](https://github.com/PolarisMesh/polaris#getting-started)。
#### 启动应用

@ -2,7 +2,7 @@
## Example Introduction
The examples will explain how to use```spring-cloud-starter-tencent-polaris-circuitbreaker``` in Spring Cloud project and other features
This example shows how to use```spring-cloud-starter-tencent-polaris-circuitbreaker``` in Spring Cloud project and other features
This example is divided to two microservice, ```polaris-circuitbreaker-example-a``` and ```polaris-circuitbreaker-example-b```. In these two microservices, ```polaris-circuitbreaker-example-a``` invokes ```polaris-circuitbreaker-example-b```.
@ -10,7 +10,7 @@ This example is divided to two microservice, ```polaris-circuitbreaker-example-a
### Configuration
```src/main/resources``` and ```bootstrap.yml``` of two micro-services add the following instructions. ${ip} and ${port} are Polaris backend IP address and port number.
The configuration is as the following shows. ${ip} and ${port} are Polaris backend IP address and port number.
```yaml
spring:
@ -18,20 +18,19 @@ spring:
name: ${application.name}
cloud:
polaris:
server-addr: ${ip}:${port}
address: ${ip}:${port}
```
###Launching Example
###Launching Polaris Backend Service
Reference to [Polaris](https://github.com/polarismesh)
Reference to [Polaris Getting Started](https://github.com/PolarisMesh/polaris#getting-started)
####Launching Application
Note, because verification is needed for circuit-break feature, therefore, one needs to deploy more than two invoked services (two deployment in this example)
Launching```spring-cloud-tencent-examples/polaris-circuitbreaker-example/polaris-circuitbreaker-example-a```'s ServiceA and ```spring-cloud-tencent-examples/polaris-circuitbreaker-example/polaris-circuitbreaker-example-b```'s ServiceB
note, Service B needs to launch two. One can adjust the port on the same machine.
@ -40,7 +39,7 @@ Two Services B's ```com.tencent.cloud.polaris.circuitbreaker.example.ServiceBCon
- Maven Package Launching
Execute under ``spring-cloud-tencent-examples/polaris-discovery-example```
Execute under ```spring-cloud-tencent-examples/polaris-discovery-example```
note, Service B needs to launch two. One can adjust the port on the same machine.

@ -1,4 +1,4 @@
# Polaris Discovery example
# Spring Cloud Polaris Discovery example
## 样例简介
@ -10,7 +10,7 @@
### 修改配置
在两个微服务的```src/main/resources```下的```bootstrap.yml```文件中添加如下配置。其中,${ip}和${port}为Polaris后端服务的IP地址与端口号。
配置如下所示。其中,${ip}和${port}为Polaris后端服务的IP地址与端口号。
```yaml
spring:
@ -18,14 +18,14 @@ spring:
name: ${application.name}
cloud:
polaris:
server-addr: ${ip}:${port}
address: ${ip}:${port}
```
### 启动样例
#### 启动Polaris后端服务
参考[Polaris](https://github.com/polarismesh)。
参考[Polaris Getting Started](https://github.com/PolarisMesh/polaris#getting-started)。
#### 启动应用

@ -1,8 +1,8 @@
# Polaris Discovery example
# Spring Cloud Polaris Discovery example
## Example Introduction
The examples will explain how to use ```spring-cloud-starter-tencent-polaris-discovery`` in Spring Cloud project for its features.
This example shows how to use ```spring-cloud-starter-tencent-polaris-discovery`` in Spring Cloud project for its features.
This example is divided to two microservice, discovery-caller-service and discovery-callee-service. In these two microservices, discovery-caller-service invokes discovery-callee-service.
@ -10,7 +10,7 @@ This example is divided to two microservice, discovery-caller-service and discov
### Configuration
```src/main/resources``` and ```bootstrap.yml``` of two micro-services add the following instructions. ${ip} and ${port} are Polaris backend IP address and port number.
The configuration is as the following shows. ${ip} and ${port} are Polaris backend IP address and port number.
```yaml
spring:
@ -18,20 +18,20 @@ spring:
name: ${application.name}
cloud:
polaris:
server-addr: ${ip}:${port}
address: ${ip}:${port}
```
### Launching Example
#### Launching Polaris Backend Service
Reference to [Polaris](https://github.com/polarismesh)
Reference to [Polaris Getting Started](https://github.com/PolarisMesh/polaris#getting-started)
#### Launching Application
- IDEA Launching
Launching ```spring-cloud-tencent-examples/polaris-discovery-example/discovery-caller-service```'s ``DiscoveryCallerService``` and ``spring-cloud-tencent-examples/polaris-discovery-example/discovery-callee-service```'s ```DiscoveryCalleeService``
Launching ```spring-cloud-tencent-examples/polaris-discovery-example/discovery-caller-service```'s ```DiscoveryCallerService``` and ```spring-cloud-tencent-examples/polaris-discovery-example/discovery-callee-service```'s ```DiscoveryCalleeService```
- Maven Package Launching

@ -0,0 +1,77 @@
# Spring Cloud Polaris Gateway example
## 样例简介
本样例将介绍如何在Spring Cloud项目中使用```spring-cloud-tencent-polaris-gateway```以使用其各项功能。
本样例包括```gateway-zuul-service```、```gateway-scg-service```和```gateway-callee-service```。```gateway-zuul-service```和```gateway-scg-service```调用```gateway-callee-service```。
## 使用说明
### 修改配置
配置如下所示。其中,${ip}和${port}为Polaris后端服务的IP地址与端口号。
```yaml
spring:
application:
name: ${application.name}
cloud:
polaris:
address: ${ip}:${port}
```
### 启动样例
#### 启动Polaris后端服务
参考[Polaris Getting Started](https://github.com/PolarisMesh/polaris#getting-started)。
#### 启动应用
- IDEA启动
分别启动```spring-cloud-tencent-examples/polaris-gateway-example/gateway-zuul-service```的```GatewayZuulService```、```spring-cloud-tencent-examples/polaris-gateway-example/gateway-scg-service```的```GatewayScgService```和```spring-cloud-tencent-examples/polaris-gateway-example/gateway-callee-service```的```GatewayCalleeService```
- Maven打包启动
在```spring-cloud-tencent-examples/polaris-gateway-example```下执行
```sh
mvn clean package
```
然后在```gateway-zuul-service```、```gateway-scg-service```和```gateway-callee-service```下找到生成的jar包运行
```
java -jar ${app.jar}
```
启动应用,其中${app.jar}替换为对应的jar包名。
### 验证
#### Zuul调用
```shell
curl -L -X GET 'http://localhost:48082/GatewayCalleeService/gateway/example/callee/echo' -H 'SCT-CUSTOM-METADATA: {"b": 2}'
```
预期返回值
```
{"a":"1","b":2}
```
#### Spring-Cloud-Gateway调用
```shell
curl -L -X GET 'http://localhost:48083/GatewayCalleeService/gateway/example/callee/echo' -H 'SCT-CUSTOM-METADATA: {"b": 2}'
```
预期返回值
```
{"a":"1","b":2}
```

@ -0,0 +1,77 @@
# Spring Cloud Polaris Gateway example
## Example Introduction
This example shows how to use ```spring-cloud-tencent-polaris-gateway`` in Spring Cloud project for its features.
This example contains ```gateway-zuul-service```, ```gateway-scg-service``` and ```gateway-callee-service```. ```gateway-zuul-service``` and ```gateway-scg-service``` invoke ```gateway-callee-service```.
## Instruction
### Configuration
The configuration is as the following shows. ${ip} and ${port} are Polaris backend IP address and port number.
```yaml
spring:
application:
name: ${application.name}
cloud:
polaris:
address: ${ip}:${port}
```
### Launching Example
#### Launching Polaris Backend Service
Reference to [Polaris Getting Started](https://github.com/PolarisMesh/polaris#getting-started)
#### Launching Application
- IDEA Launching
Launching ```spring-cloud-tencent-examples/polaris-gateway-example/gateway-zuul-service```'s ```GatewayZuulService```, ```spring-cloud-tencent-examples/polaris-gateway-example/gateway-scg-service```'s ```GatewayScgService``` and ```spring-cloud-tencent-examples/polaris-gateway-example/gateway-callee-service```'s ```GatewayCalleeService```
- Maven Package Launching
Execute under ```spring-cloud-tencent-examples/polaris-gateway-example```
```sh
mvn clean package
```
Then find the jars under ```gateway-zuul-service```, ```gateway-scg-service``` and ```gateway-callee-service```, and run it:
```
java -jar ${app.jar}
```
Launch application, change ${app.jar} to jar's package name.
### Verify
#### Zuul Invoke
```shell
curl -L -X GET 'http://localhost:48082/GatewayCalleeService/gateway/example/callee/echo' -H 'SCT-CUSTOM-METADATA: {"b": 2}'
```
Expected return rate
```
{"a":"1","b":2}
```
#### Spring-Cloud-Gateway Invoke
```shell
curl -L -X GET 'http://localhost:48083/GatewayCalleeService/gateway/example/callee/echo' -H 'SCT-CUSTOM-METADATA: {"b": 2}'
```
Expected return rate
```
{"a":"1","b":2}
```

@ -1,11 +1,9 @@
# Polaris RateLimit Example
# Spring Cloud Polaris RateLimit Example
## 项目说明
本项目演示如何使用 Polaris ratelimit starter 完成 Spring Cloud 应用的限流管理。
[Polaris](https://github.com/polarismesh):北极星是腾讯开源的云原生的服务治理平台及组件,提供多维度的服务限流功能,防护应用系统的可靠性。
## 示例
### 如何接入

@ -1,11 +1,9 @@
# Polaris RateLimit Example
# Spring Cloud Polaris RateLimit Example
## Project Explanation
This project shows how to use ratelimit feature of Polaris to complete Spring Cloud application's rate limit
[Polaris](https://github.com/polarismesh): Polaris is Tencent open source cloud-native's operation centre and component, provide multi dimensional rate limit service and reliability of application firewall
## Example
### How to access

Loading…
Cancel
Save