docs:move docs to wiki

pull/49/head
SkyeBeFreeman 3 years ago
parent ee72f94b23
commit d8106a2445

@ -41,7 +41,6 @@
<module>spring-cloud-tencent-dependencies</module>
<module>spring-cloud-tencent-starters</module>
<module>spring-cloud-tencent-examples</module>
<module>spring-cloud-tencent-docs</module>
<module>spring-cloud-tencent-coverage</module>
</modules>

@ -1,21 +0,0 @@
<?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">
<parent>
<artifactId>spring-cloud-tencent</artifactId>
<groupId>com.tencent.cloud</groupId>
<version>${revision}</version>
<relativePath>../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>spring-cloud-tencent-docs</artifactId>
<name>Spring Cloud Tencent Documentation</name>
<packaging>pom</packaging>
<properties>
<maven.deploy.skip>true</maven.deploy.skip>
</properties>
</project>

@ -1,17 +0,0 @@
# 依赖管理
如果您想使用Spring Cloud Tencent微服务开发套件您可以直接依赖以下bom即在pom.xml的<dependencyManagement>中添加如下代码。后续使用bom下的依赖无需带版本号即可引入。
```xml
<dependencyManagement>
<dependencies>
<dependency>
<groupId>com.tencent.cloud</groupId>
<artifactId>spring-cloud-tencent-dependencies</artifactId>
<version>0.1.0.Hoxton.BETA</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
```

@ -1,59 +0,0 @@
# Spring Cloud Tencent Metadata
## 使用方式
### 可传递的自定义metadata
> 可以从主调方传递给被调方的metadata
- 获取只读的所有可传递的自定义metadata的映射表
```
Map<String, String> customMetadataMap = MetadataContextHolder.get().getAllTransitiveCustomMetadata();
```
- 根据key获取可传递的自定义metadata
```
String value = MetadataContextHolder.get().getTransitiveCustomMetadata(KEY);
```
- 以key-value形式保存可传递的自定义metadata
```
MetadataContextHolder.get().putTransitiveCustomMetadata(KEY, VALUE);
```
- 从一个映射表中读取并保存到可传递的自定义metadata映射表中
```
MetadataContextHolder.get().putAllTransitiveCustomMetadata(ANOTHER_MAP);
```
### 系统metadata
> 系统metadata不可被传递。
- 获取只读的所有系统metadata的映射表
```
Map<String, String> systemMetadataMap = MetadataContextHolder.get().getAllSystemMetadata();
```
- 根据key获取系统metadata
```
String value = MetadataContextHolder.get().getSystemMetadata(KEY);
```
- 以key-value形式保存系统metadata
```
MetadataContextHolder.get().putSystemMetadata(KEY, VALUE);
```
- 从一个映射表中读取并保存到系统metadata映射表中
```
MetadataContextHolder.get().putAllSystemMetadata(ANOTHER_MAP);
```
- 系统metadata映射表的key如下所示
- LOCAL_NAMESPACE
- LOCAL_SERVICE
- LOCAL_PATH
- PEER_NAMESPACE
- PEER_SERVICE
- PEER_PATH

@ -1,43 +0,0 @@
# Polaris CircuitBreaker
## 模块简介
```spring-cloud-starter-tencent-polaris-circuitbreaker```是用于Spring
Cloud项目对接服务治理平台[Polaris](https://github.com/polarismesh)的故障熔断模块。
您可以通过引入依赖即可获得对微服务架构的服务限流能力。建议与```spring-cloud-starter-tencent-polaris-discovery```配合使用。
## 功能介绍
### 故障节点熔断
故障实例熔断能实现主调方迅速自动屏蔽错误率高或故障的服务实例,并启动定时任务对熔断实例进行探活。在达到恢复条件后对其进行半开恢复。在半开恢复后,释放少量请求去进行真实业务探测。并根据真实业务探测结果去判断是否完全恢复正常。
### 熔断策略
- 故障比例熔断当服务实例在上一个时间窗默认1分钟通过的请求量达到或超过最小请求阈值默认10个且错误率达到或超过故障比率阈值默认50%),实例会进入隔离状态。故障比率的阈值范围是 [0.0, 1.0],代表 0% - 100%。
- 连续故障熔断当实例在上一个时间窗默认1分钟连续失败的请求数达到或者超过连续故障阈值默认10个实例会进入隔离状态。
- 熔断隔离时间默认隔离30s支持可配置。
相关配置请参考[PolarisJava使用文档](https://github.com/PolarisMesh/polaris-java)
## 快速入门
本章节将介绍如何最简单地在Spring Cloud项目中使用Polaris
CircuitBreaker的功能。启动微服务之前需要启动Polaris具体启动方式参考[Polaris Getting Started](https://github.com/PolarisMesh/polaris#getting-started)。
1. 您可以在项目中加入```spring-cloud-starter-tencent-polaris-circuitbreaker```依赖即可使用故障熔断的特性。如Maven项目中在pom中添加如下配置
```XML
<dependency>
<groupId>com.tencent.cloud</groupId>
<artifactId>spring-cloud-starter-tencent-polaris-circuitbreaker</artifactId>
</dependency>
```
2. 更加详细的使用方法参考 [Polaris CircuitBreaker Example](../../../../spring-cloud-tencent-examples/polaris-circuitbreaker-example/README-zh.md)。
## 配置列表
| 配置项Key | 默认值 |是否必填| 配置项说明 |
| ----------------------------------------------- | -----------------------| --------- | ---------------------------- |
| spring.cloud.polaris.circuitbreaker.enabled | true |否| 是否开启故障熔断 |

@ -1,101 +0,0 @@
# Polaris Discovery
## 模块简介
```spring-cloud-starter-tencent-polaris-discovery```是用于Spring
Cloud项目对接服务治理平台[Polaris](https://github.com/PolarisMesh/polaris)的服务发现模块。您可以通过引入依赖即可完成微服务注册到服务治理平台Polaris获得对整个微服务架构的服务治理能力。
## 功能介绍
### 服务注册与发现
基于Spring Cloud的标准接口实现服务注册与发现。
### 服务路由
基于Ribbon的标准接口实现的支持多种场景的动态服务路由是北极星提供规则路由的能力通过规则来动态控制消息的分配转发。通过该功能您者可以轻松实现多环境路由、分SET路由、灰度发布、集群容灾降级、金丝雀测试等功能。
同时,用户也可以利用独立于服务发现模块的自定义元数据功能来形成路由规则进行规则路由,进一步提升服务路由的灵活性。
### 负载均衡
负载均衡支持从满足本次转发要求的服务实例集中, 通过一定的均衡策略,选取一个实例返回给主调方,供主调方进行服务请求发送。负载均衡规则包括权重随机策略、权重响应时间策略和一致性哈希算法。
## 快速入门
本章节将介绍如何最简单地在Spring Cloud项目中使用Polaris
Discovery的功能。启动微服务之前需要启动Polaris具体启动方式参考[Polaris Getting Started](https://github.com/PolarisMesh/polaris#getting-started)。
1. 您可以在项目中加入```spring-cloud-starter-tencent-polaris-discovery```依赖即可使用Polaris的服务注册与发现功能。如Maven项目中在pom中添加如下配置
```XML
<dependency>
<groupId>com.tencent.cloud</groupId>
<artifactId>spring-cloud-starter-tencent-polaris-discovery</artifactId>
</dependency>
```
2. 在配置文件中主要添加如下配置即可完成服务注册与发现在Spring Cloud Edgware之后无需使用```@EnableDiscoveryClient```即可进行服务注册与发现):
```yaml
spring:
application:
name: ${application.name}
cloud:
polaris:
address: ${protocol}://${ip}:${port}
```
3. 如果您部署的是单机版Polaris您需要在项目中添加如下Polaris参数.../resources/polaris.yml
```yaml
global:
system:
discoverCluster:
sameAsBuiltin: true
healthCheckCluster:
sameAsBuiltin: true
```
更加详细的使用方法参考 [Polaris Discovery Example](../../../../spring-cloud-tencent-examples/polaris-discovery-example/README-zh.md)。
## 拓展使用
### 服务路由
- 您可以在Polaris控制台页面上配置路由规则即可使用服务路由的功能。
- 您也可以在配置文件application.yml中添加自定义元数据然后再Polaris控制台页面上配置路由规则也可使用服务路由的功能。样例配置如下所示在应用运行时将读为Map的数据格式。
```
spring:
cloud:
tencent:
content:
a: 1
b: 2
```
### 负载均衡
以权重随机策略为例您可以在Polaris控制台页面上或者配置文件application.yml中添加权重值即可使用负载均衡的功能。
## 配置列表
| 配置项Key | 默认值 | 是否必填 | 配置项说明 |
|-------------------------------------------------|----------------------------|------|---------------------------|
| spring.cloud.polaris.server-addr | 无 | 是 | Polaris后端地址 |
| spring.cloud.polaris.discovery.service | ${spring.application.name} | 否 | 服务名称 |
| spring.cloud.polaris.discovery.enabled | true | 否 | 是否开启服务注册与发现 |
| spring.cloud.polaris.discovery.namespace | default | 否 | 服务所在的命名空间名称 |
| spring.cloud.polaris.discovery.instance-enabled | true | 否 | 当前微服务实例是否可以被访问 |
| spring.cloud.polaris.discovery.token | 无 | 否 | 鉴权Token |
| spring.cloud.polaris.discovery.version | null | 否 | 微服务版本 |
| spring.cloud.polaris.discovery.ip-address | null | 否 | 注册的IP地址 |
| spring.cloud.polaris.protocol | null | 否 | 微服务协议类型 |
| spring.cloud.polaris.weight | 100 | 否 | 微服务权重 |
| spring.cloud.loadbalancer.polaris.enabled | true | 否 | 是否开启负载均衡 |
| spring.cloud.loadbalancer.polaris.strategy | weighted_random | 否 | 负载均衡策略 |
| spring.cloud.tencent.metadata.content | 无 | 否 | 自定义元数据为Map结构 |
| spring.cloud.tencent.metadata.transitive | 无 | 否 | 需要传递的自定义元数据的key列表为List结构 |

@ -1,43 +0,0 @@
# 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)即可。
### 网关限流
其依赖的是```spring-cloud-starter-tencent-polaris-ratelimit```模块的功能,因此使用上参考[Polaris RateLimit](spring-cloud-tencent-polaris-ratelimit.md)即可。

@ -1,48 +0,0 @@
# Polaris RateLimit
## 模块简介
```spring-cloud-starter-tencent-polaris-ratelimit```是用于Spring
Cloud项目对接服务治理平台[Polaris](https://github.com/PolarisMesh/polaris)的服务限流模块。
您可以通过引入依赖即可获得对微服务架构的服务限流能力。建议与```spring-cloud-starter-tencent-polaris-discovery```配合使用。
## 功能介绍
### 服务级限流
支持为所有的HTTP服务提供限流功能。
默认引入spring-cloud-starter-tencent-polaris-ratelimit依赖即可对所有的HTTP服务执行限流检查。
### 接口级限流
支持为所有的HTTP调用根据path级别的提供限流功能。
默认引入spring-cloud-starter-tencent-polaris-ratelimit依赖即可对所有的HTTP path调用执行限流检查。
## 快速入门
本章节将介绍如何最简单地在Spring Cloud项目中使用Polaris
RateLimit的功能。启动微服务之前需要启动Polaris具体启动方式参考[Polaris Getting Started](https://github.com/PolarisMesh/polaris#getting-started)。
1. 您可以在项目中加入```spring-cloud-starter-tencent-polaris-ratelimit```依赖即可使用服务限流的特性。如Maven项目中在pom中添加如下配置
```XML
<dependency>
<groupId>com.tencent.cloud</groupId>
<artifactId>spring-cloud-starter-tencent-polaris-ratelimit</artifactId>
</dependency>
```
2. 添加限流规则配置
北极星提供了三种添加限流配置的方式包括控制台操作、HTTP接口上传和本地文件配置具体请参考[北极星Java使用文档](https://github.com/PolarisMesh/polaris-java)
更加详细的使用方法参考 [Polaris RateLimit Example](../../../../spring-cloud-tencent-examples/polaris-ratelimit-example/README-zh.md)。
## 配置列表
| 配置项Key | 默认值 |是否必填| 配置项说明 |
| ----------------------------------------------- | -----------------------| --------- | ---------------------------- |
| spring.cloud.polaris.ratelimit.enabled | true |否| 是否开启服务限流 |

@ -1,18 +0,0 @@
# dependencyManagement
if you want to use Spring Cloud Tencent micro-service software development kit, you can depend on the bom as below, add code as below at ```<dependencyManagement>``` in pom.xml. Going forward, continue using dependencies in bom no longer needs version number.
```xml
<dependencyManagement>
<dependencies>
<dependency>
<groupId>com.tencent.cloud</groupId>
<artifactId>spring-cloud-tencent-dependencies</artifactId>
<version>0.1.0.Hoxton.BETA</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
```

@ -1,59 +0,0 @@
# Spring Cloud Tencent Metadata
## Usage
### Transitive Custom Metadata
> Transitive custom metadata can be transferred from caller to callee.
- Get all transitive custom metadata with read-only.
```
Map<String, String> customMetadataMap = MetadataContextHolder.get().getAllTransitiveCustomMetadata();
```
- Get transitive custom metadata with key.
```
String value = MetadataContextHolder.get().getTransitiveCustomMetadata(KEY);
```
- Put transitive custom metadata with key-value.
```
MetadataContextHolder.get().putTransitiveCustomMetadata(KEY, VALUE);
```
- Put transitive custom metadata with another map.
```
MetadataContextHolder.get().putAllTransitiveCustomMetadata(ANOTHER_MAP);
```
### System Metadata
> System metadata cannot be transferred.
- Get all system metadata with read-only.
```
Map<String, String> systemMetadataMap = MetadataContextHolder.get().getAllSystemMetadata();
```
- Get system metadata with key.
```
String value = MetadataContextHolder.get().getSystemMetadata(KEY);
```
- Put system metadata with key-value.
```
MetadataContextHolder.get().putSystemMetadata(KEY, VALUE);
```
- Put system metadata with another map.
```
MetadataContextHolder.get().putAllSystemMetadata(ANOTHER_MAP);
```
- Map key list:
- LOCAL_NAMESPACE
- LOCAL_SERVICE
- LOCAL_PATH
- PEER_NAMESPACE
- PEER_SERVICE
- PEER_PATH

@ -1,43 +0,0 @@
# Spring Cloud Starter Tencent Polaris CircuitBreaker
## 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```.
## Key Features
### Failed Node CircuitBreaker
Failed instance circuitbreak can achieve caller service's immediate auto-block high failure rate command instance, and set timed task to conduct live probing. When the recover status is achieved, one can start half recovery. After half recovery, release a few request to test probing. Identify the recovery status from the probing result.
### CircuitBreaker Strategy
- Failed ratio circuitbreak: when command instance at a service window (default one minute) request rate has reached or passed the minimum request threshold (default 10), and failure rate reached or passed failure ratio threshold (default 50%), instance will enter insolation state. Failure rate threshold range is [0.0, 1.0] , represent 0% - 100%.
- continuous failure circuitbreak: when command instance at a service window (default), continuous failure request reached or exceeded failure threshold (default 10), instance will inter insolation state.
- circuitbreak insolation time: default 30 seconds, support configuration
For configuration, please refer to [Polaris CircuitBreaker](https://github.com/polarismesh)
## 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 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:
```XML
<dependency>
<groupId>com.tencent.cloud</groupId>
<artifactId>spring-cloud-starter-tencent-polaris-circuitbreaker</artifactId>
</dependency>
```
2. For further instructions, please refer to [Polaris CircuitBreaker Example](../../../../spring-cloud-tencent-examples/polaris-circuitbreaker-example/README.md).
## Configuration List
| Configuration Key | default | Must Fill | Configuration Instruction |
| ------------------------------------------- | ------- | --------- | ---------------------------- |
| spring.cloud.polaris.circuitbreaker.enabled | true | false | Whether turn on CircuitBreak |

@ -1,98 +0,0 @@
# Spring Cloud Starter Tencent Polaris Discovery
## 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.
## Features Instruction
### Service Registration and Discovery
Spring Cloud API to achieve service registration and discovery.
### Service Route
Foundation built on Ribbon's API allows multiple application's dynamic service route, provided by Polaris's policy route feature. One can assign and control tasks through this feature. Through this feature, one can easily adapt different applications, SET routing, greyscale release, disaster recovery degrade, and canary test etc.
Meanwhile, users can use independent discovery component's custom data feature to program routing, further improve its agility and performance.
### CLoud Load Balance
CLB supports qualified packet forwarding in the service instance. Through set balancing, send a selected instance to the caller service, to support caller's service request. CLB rule includes random weight policy, weight response time and coordinated Hash.
## User Guide
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 dependencies in your project to use Polaris's service registration and discovery feature. For example, in Maven's project, add listed configurations in pom:
```XML
<dependency>
<groupId>com.tencent.cloud</groupId>
<artifactId>spring-cloud-starter-tencent-polaris-discovery</artifactId>
</dependency>
```
2. Add listed configurations in the document, one can complete service registration and discovery (after Spring Cloud Edgware, ```@EnableDiscoveryClient``` is no longer needed to run service registration and discovery):
```yaml
spring:
application:
name: ${application.name}
cloud:
polaris:
server-addr: ${ip}:${port}
```
3. If you deploy standalone Polaris, you should add this polaris configuration in your project(.../resources/polaris.yml):
```yaml
global:
system:
discoverCluster:
sameAsBuiltin: true
healthCheckCluster:
sameAsBuiltin: true
```
For further instructions, please refer to [Polaris Discovery Example](../../../../spring-cloud-tencent-examples/polaris-discovery-example/README.md).
## Extended Application
### Service Route
- you can configure routing policy at Polaris control panel, and use the features.
- you can add custom metadata at configure documentations (application.yml), Then configure routing policy at Polaris control panel, one can also use the features. Example listed below, this will be read as Metadata Map.
```
spring:
cloud:
tencent:
content:
a: 1
b: 2
```
### Cloud Load Balancing
Taking examples like random weight policy, you can add weight at Polaris control panel or configure documentations (application.yml) to access CLB features.
## Configuration LIst
| ConfigurationKey | default | Yes/No required | Configuration Instruction |
|-------------------------------------------------|----------------------------|-----------------|------------------------------------------------------|
| spring.cloud.polaris.server-addr | false | yes | Polaris backend address |
| spring.cloud.polaris.discovery.service | ${spring.application.name} | null | service name |
| spring.cloud.polaris.discovery.enabled | true | false | whether to active service registration and discovery |
| spring.cloud.polaris.discovery.namespace | default | false | the namespace of service |
| spring.cloud.polaris.discovery.instance-enabled | true | false | can current Microservice be visited |
| spring.cloud.polaris.discovery.token | false | false | Authentication Token |
| spring.cloud.polaris.discovery.version | null | false | Microservice Version |
| spring.cloud.polaris.discovery.ip-address | null | false | Ip address to be registered |
| spring.cloud.polaris.protocol | null | false | Microservice agreement type |
| spring.cloud.polaris.weight | 100 | false | Microservice weight |
| spring.cloud.loadbalancer.polaris.enabled | true | false | whether to open CLB |
| spring.cloud.loadbalancer.polaris.strategy | weighted_random | false | CLB policy |
| spring.cloud.tencent.metadata.content | null | false | custom metadata Map |
| spring.cloud.tencent.metadata.transitive | null | false | need custom metadata key list |

@ -1,47 +0,0 @@
# 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.
### Gateway RateLimit
Support rate limit of gateway routing to the corresponding micro-service.
## 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).
## Feature Usage
### Metadata Delivery
Because making use of ```spring-cloud-tencent-metadata```, please refer to [Spring Cloud Tencent Metadata](spring-cloud-tencent-metadata.md).
### Gateway RateLimit
Because making use of ```spring-cloud-starter-tencent-polaris-ratelimit```, please refer to [Spring Cloud Tencent Metadata](spring-cloud-tencent-polaris-ratelimit.md).

@ -1,47 +0,0 @@
# Spring Cloud Starter Tencent Polaris RateLimit
## Module Introduction
```spring-cloud-starter-tencent-polaris-ratelimit``` is used in Spring
Cloud project joint with [Polaris](https://github.com/polarismesh)'s rate limit component.
You can access Microservice's rate limit through dependencies. Recommended using with ```spring-cloud-starter-tencent-polaris-discovery```
## Features Introduction
### Service Rate Limit
Provide rate limit feature to all HTTP server.
Default introduce spring-cloud-starter-tencent-polaris-ratelimit dependencies can apply rate limit check to all HTTP server.
### API Rate Limit
Provide rate limit feature to all HTTP server depending on the path level
Default introduce spring-cloud-starter-tencent-polaris-ratelimit dependencies can apply rate limit check to all HTTP server path.
## 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 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:
```XML
<dependency>
<groupId>com.tencent.cloud</groupId>
<artifactId>spring-cloud-starter-tencent-polaris-ratelimit</artifactId>
</dependency>
```
2. Add rate limit configuration
Polaris provides three different configuration methods, control panel operation, HTTP API upload and local files configuration, further information please refer to [Polaris service rate limit operation guide](https://github.com/polarismesh)
For more details, please refer to [Polaris RateLimit Example](../../../../spring-cloud-tencent-examples/polaris-ratelimit-example/README.md)
## Configuration list
| Configuration Key | default | yes/no required | Configuration Instruction |
| -------------------------------------- | ------- | --------------- | ----------------------------- |
| spring.cloud.polaris.ratelimit.enabled | true | false | whether to turn on rate limit |
Loading…
Cancel
Save