commit
dc2185df45
@ -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,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).
|
|
||||||
|
|
Loading…
Reference in new issue