diff --git a/CHANGELOG.md b/CHANGELOG.md
index 89aaae027..06c1f8175 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,5 +1,3 @@
# Change Log
---
-- [fix: fix not load application.yml bug & fix guava version conflict bug.](https://github.com/Tencent/spring-cloud-tencent/pull/286)
-- [fix:add junit test in config module.](https://github.com/Tencent/spring-cloud-tencent/pull/288)
diff --git a/README-zh.md b/README-zh.md
index 55777380d..158cda87d 100644
--- a/README-zh.md
+++ b/README-zh.md
@@ -5,54 +5,69 @@
[![Contributors](https://img.shields.io/github/contributors/Tencent/spring-cloud-tencent)](https://github.com/Tencent/spring-cloud-tencent/graphs/contributors)
[![License](https://img.shields.io/badge/License-BSD%203--Clause-blue.svg)](https://opensource.org/licenses/BSD-3-Clause)
-[![Build Status](https://github.com/Tencent/spring-cloud-tencent/actions/workflows/junit_test.yml/badge.svg)](https://github.com/Tencent/spring-cloud-tencent/actions/workflows/junit_test.yml)
+[![Test with Junit](https://github.com/Tencent/spring-cloud-tencent/actions/workflows/junit_test.yml/badge.svg?branch=greenwich)](https://github.com/Tencent/spring-cloud-tencent/actions/workflows/junit_test.yml)
[![codecov.io](https://codecov.io/gh/Tencent/spring-cloud-tencent/branch/greenwich/graph/badge.svg)](https://codecov.io/gh/Tencent/spring-cloud-tencent?branch=greenwich)
-[![Language grade: Java](https://img.shields.io/lgtm/grade/java/g/Tencent/spring-cloud-tencent.svg?logo=lgtm&logoWidth=18)](https://lgtm.com/projects/g/Tencent/spring-cloud-tencent/context:java)
-[English](./README.md) | 简体中文
+[English](./README.md) | 简体中文
----
+README:
+
+- [介绍](#介绍)
+- [如何构建](#如何构建)
+- [如何使用](#如何使用)
+- [使用示例](#使用示例)
+
+更多文档请查看[Wiki](https://github.com/Tencent/spring-cloud-tencent/wiki)
## 介绍
-Spring Cloud Tencent 是腾讯开源的一站式微服务解决方案。
+Spring Cloud Tencent 是基于 Spring Cloud SPI 实现的一站式微服务解决方案。通过集成 Spring Cloud
+和腾讯中间件,让分布式服务和微服务的开发、测试、发布和运维变得更加简单。
+
+
+
+**服务发现和治理**
+
+Spring Cloud Tencent 集成 Spring Cloud 和北极星。北极星是一个支持多语言和多框架的服务发现和治理平台。
-Spring Cloud Tencent 实现了Spring Cloud 标准微服务 SPI,开发者可以基于 Spring Cloud Tencent 快速开发 Spring Cloud 云原生分布式应用。
+- [北极星 Github](https://github.com/polarismesh/polaris)
-Spring Cloud Tencent 的核心依托腾讯开源的一站式服务发现与治理平台 [Polaris](https://github.com/polarismesh/polaris),实现各种分布式微服务场景。
+Spring Cloud 集成北极星可以解决以下问题:
-- [Polaris Github home page](https://github.com/polarismesh/polaris)
-- [Polaris official website](https://polarismesh.cn/)
+- 服务管理:服务发现、服务发现、健康检查
+- 流量控制:可自定义的流量路由、负载均衡、限频限流、访问控制
+- 故障容错:服务和接口熔断和降级、实例熔断和切换
+- 配置管理:版本管理、灰度发布、动态更新
-Spring Cloud Tencent提供的能力包括但不限于:
+## 如何构建
-
+运行以下命令进行构建。
-- 服务注册和发现
-- 动态配置管理
-- 服务治理
- - 服务限流
- - 服务熔断
- - 服务路由
- - ...
-- 标签透传
+**Linux and Mac**
-## 体验环境
+```
+./mvnw clean package
+```
-- 管控台地址: http://14.116.241.63:8080/
- - 账号:polaris
- - 密码:polaris
-- 控制面地址: `grpc://183.47.111.80:8091`
--
- `spring-cloud-tencent-example` 下 example 地址都默认指向了体验服务地址(`grpc://183.47.111.80:8091`),如果您只是体验 Spring Cloud Tencent,可直接一键运行任何 example。
-## 管控台
+**Windows**
-
+```
+.\mvnw.cmd clean package
+```
-## 使用指南
+## 如何使用
Spring Cloud Tencent 所有组件都已上传到 Maven 中央仓库,只需要引入依赖即可。
+> 注意:
+>
+> 支持Spring Cloud 版本:2022.0、2021.0、2020.0、Hoxton。
+>
+> Spring Cloud Tencent
+> 的版本列表可以查看
+> [Spring Cloud Tencent 版本管理](https://github.com/Tencent/spring-cloud-tencent/wiki/Spring-Cloud-Tencent-%E7%89%88%E6%9C%AC%E7%AE%A1%E7%90%86)
+> 。
+
例如:
```` xml
@@ -63,7 +78,7 @@ Spring Cloud Tencent 所有组件都已上传到 Maven 中央仓库,只需要
com.tencent.cloud
spring-cloud-tencent-dependencies
- ${version}
+ 1.11.4-2021.0.6
pom
import
@@ -80,32 +95,21 @@ Spring Cloud Tencent 所有组件都已上传到 Maven 中央仓库,只需要
````
-- ### 快速开始
- - [Spring Cloud Tencent 版本管理](https://github.com/Tencent/spring-cloud-tencent/wiki/Spring-Cloud-Tencent-Version-Management)
- - [Spring Cloud Tencent 服务注册与发现](https://github.com/Tencent/spring-cloud-tencent/wiki/Spring-Cloud-Tencent-Discovery-Usage-Documentation)
- - [Spring Cloud Tencent 配置中心](https://github.com/Tencent/spring-cloud-tencent/wiki/Spring-Cloud-Tencent-Config-Usage-Documentation)
- - [Spring Cloud Tencent 限流](https://github.com/Tencent/spring-cloud-tencent/wiki/Spring-Cloud-Tencent-Rate-Limit-Usage-Document)
- - [Spring Cloud Tencent 熔断](https://github.com/Tencent/spring-cloud-tencent/wiki/Spring-Cloud-Tencent-Circuitbreaker-Usage-Document)
- - [Spring Cloud Tencent 服务路由](https://github.com/Tencent/spring-cloud-tencent/wiki/Spring-Cloud-Tencent-Router-Usage-Document)
- - [Spring Cloud Tencent 标签传递](https://github.com/Tencent/spring-cloud-tencent/wiki/Spring-Cloud-Tencent-Metadata-Transfer-Usage-Document)
+## 使用示例
-- ### 开发文档
- - [项目概览](https://github.com/Tencent/spring-cloud-tencent/wiki/%E9%A1%B9%E7%9B%AE%E6%A6%82%E8%A7%88)
- - [参与共建](https://github.com/Tencent/spring-cloud-tencent/wiki/Contributing)
+北极星为开发者提供体验环境:
-## 交流群
+- [北极星控制台](http://119.91.66.223:80)
+- 北极星服务端地址:`grpc://119.91.66.223:8091`
-扫描下面的二维码加入 Spring Cloud Tencent 交流群。
+在 spring-cloud-tencent-example 项目里,北极星服务端地址默认配置为`grpc://119.91.66.223:8091`。
-
+## 交流群
+扫码二维码,加入 Spring Cloud Tencent 交流群。欢迎用户反馈使用问题和优化建议。
-## License
-The spring-cloud-tencent is licensed under the BSD 3-Clause License. Copyright and license information can be found in the file [LICENSE](LICENSE)
+
## Stargazers over time
-如果您对 Spring Cloud Tencent 有兴趣,请关注我们的项目~
-
-[![Stargazers over time](https://starchart.cc/Tencent/spring-cloud-tencent.svg)](https://starchart.cc/Tencent/spring-cloud-tencent)
-
+[![](https://starchart.cc/Tencent/spring-cloud-tencent.svg)](https://starchart.cc/Tencent/spring-cloud-tencent)
diff --git a/README.md b/README.md
index 6bd65d057..d3d863b41 100644
--- a/README.md
+++ b/README.md
@@ -5,53 +5,70 @@
[![Contributors](https://img.shields.io/github/contributors/Tencent/spring-cloud-tencent)](https://github.com/Tencent/spring-cloud-tencent/graphs/contributors)
[![License](https://img.shields.io/badge/License-BSD%203--Clause-blue.svg)](https://opensource.org/licenses/BSD-3-Clause)
-[![Build Status](https://github.com/Tencent/spring-cloud-tencent/actions/workflows/junit_test.yml/badge.svg)](https://github.com/Tencent/spring-cloud-tencent/actions/workflows/junit_test.yml)
+[![Test with Junit](https://github.com/Tencent/spring-cloud-tencent/actions/workflows/junit_test.yml/badge.svg?branch=greenwich)](https://github.com/Tencent/spring-cloud-tencent/actions/workflows/junit_test.yml)
[![codecov.io](https://codecov.io/gh/Tencent/spring-cloud-tencent/branch/greenwich/graph/badge.svg)](https://codecov.io/gh/Tencent/spring-cloud-tencent?branch=greenwich)
-[![Language grade: Java](https://img.shields.io/lgtm/grade/java/g/Tencent/spring-cloud-tencent.svg?logo=lgtm&logoWidth=18)](https://lgtm.com/projects/g/Tencent/spring-cloud-tencent/context:java)
English | [简体中文](./README-zh.md)
+README:
+
+- [Introduction](#introduction)
+- [How to build](#how-to-build)
+- [How to use](#how-to-use)
+- [Examples](#examples)
+
+Visit [Wiki](https://github.com/Tencent/spring-cloud-tencent/wiki) to learn more
+
## Introduction
-Spring Cloud Tencent is a open source one-stop microservice solution from Tencent.
+Spring Cloud Tencent is an one-stop microservice solution which implements the standard Spring Cloud SPI. It integrates
+Spring Cloud with Tencent middlewares and makes it easy to develop microservice.
-Spring Cloud Tencent implements the Spring Cloud standard microservice SPI, so developers can quickly develop Spring Cloud cloud-native distributed applications based on Spring Cloud Tencent.
+
-The core of Spring Cloud Tencent relies on Tencent's open-source one-stop service discovery and governance platform [Polaris](https://github.com/polarismesh/polaris) to realize various distributed microservice scenarios.
+**Service discovery and governance**
-- [Polaris Github home page](https://github.com/polarismesh/polaris)
-- [Polaris official website](https://polarismesh.cn/)
+Spring Cloud Tencent integrates Spring Cloud with Polaris which is an open source system for service discovery and
+governance.
-The capabilities provided by Spring Cloud Tencent include but are not limited to:
+- [Polaris Github](https://github.com/polarismesh/polaris)
-
+Spring Cloud with Polaris can solve these problem:
-- Service registration and discovery
-- Dynamic configuration management
-- Service Governance
- - Service rate limit
- - Service circuit breaker
- - Service routing
- - ...
-- Label transparent transmission
+- service management: service discovery, service registry and health check
+- traffic control: customizable routing, load balance, rate limiting and access control
+- fault tolerance: circuit breaker for service, interface and instance
+- config management: config version control, grayscale release and dynamic update
-## Demo Environment
+## How to build
-- Console Address : http://14.116.241.63:8080/
- - Username: polaris
- - Password: polaris
-- Server Address: `grpc://183.47.111.80:8091`
+Run these commands to build this project as follow.
-The example addresses under `spring-cloud-tencent-example` all point to the experience service address (`grpc://183.47.111.80:8091`) by default.
-If you only experience Spring Cloud Tencent, you can run any example directly with one click.
+**Linux and Mac**
-## Screenshots
+```
+./mvnw clean package
+```
-
+**Windows**
-## Use Guide
+```
+.\mvnw.cmd clean package
+```
-All the components of Spring Cloud Tencent have been uploaded to the Maven central repository, just need to introduce dependencies.
+## How to use
+
+All the components of Spring Cloud Tencent have been uploaded to the Maven central repository, just need to introduce
+dependencies.
+
+> Notice:
+>
+> Support Spring Cloud 2022.0, 2021.0, 2020.0, Hoxton.
+>
+> The version list of Spring Cloud Tencent can be found
+> in
+> [Spring Cloud Tencent Version Management](https://github.com/Tencent/spring-cloud-tencent/wiki/Spring-Cloud-Tencent-%E7%89%88%E6%9C%AC%E7%AE%A1%E7%90%86)
+> .
For example:
@@ -63,7 +80,7 @@ For example:
com.tencent.cloud
spring-cloud-tencent-dependencies
- ${version}
+ 1.11.4-2021.0.6
pom
import
@@ -80,28 +97,20 @@ For example:
````
- - ### Quick Start
- - [Spring Cloud Tencent Version Management](https://github.com/Tencent/spring-cloud-tencent/wiki/Spring-Cloud-Tencent-Version-Management)
- - [Spring Cloud Tencent Discovery](https://github.com/Tencent/spring-cloud-tencent/wiki/Spring-Cloud-Tencent-Discovery-Usage-Documentation)
- - [Spring Cloud Tencent Config](https://github.com/Tencent/spring-cloud-tencent/wiki/Spring-Cloud-Tencent-Config-Usage-Documentation)
- - [Spring Cloud Tencent Rate Limit](https://github.com/Tencent/spring-cloud-tencent/wiki/Spring-Cloud-Tencent-Rate-Limit-Usage-Document)
- - [Spring Cloud Tencent CircuitBreaker](https://github.com/Tencent/spring-cloud-tencent/wiki/Spring-Cloud-Tencent-Circuitbreaker-Usage-Document)
- - [Spring Cloud Tencent Router](https://github.com/Tencent/spring-cloud-tencent/wiki/Spring-Cloud-Tencent-Router-Usage-Document)
- - [Spring Cloud Tencent Metadata Transfer](https://github.com/Tencent/spring-cloud-tencent/wiki/Spring-Cloud-Tencent-Metadata-Transfer-Usage-Document)
-
-- ### Development Documentation
- - [Project Structure Overview](https://github.com/Tencent/spring-cloud-tencent/wiki/%E9%A1%B9%E7%9B%AE%E6%A6%82%E8%A7%88)
- - [Participate in co-construction](https://github.com/Tencent/spring-cloud-tencent/wiki/Contributing)
-
-## Chat Group
+## Examples
-Please scan the QR code to join the chat group.
+The experience environment of Polaris is provided for developers:
+
+- [Polaris Console](http://119.91.66.223:80)
+- Polaris Server Address: `grpc://119.91.66.223:8091`
-
+The address of Polaris server in spring-cloud-tencent-example is `grpc://119.91.66.223:8091` by default.
-## License
-The spring-cloud-tencent is licensed under the BSD 3-Clause License. Copyright and license information can be found in the file [LICENSE](LICENSE)
+## Chat Group
+
+Please scan the QR code to join the chat group.
+
## Stargazers over time
diff --git a/changes/changes-1.5.4.md b/changes/changes-1.5.4.md
new file mode 100644
index 000000000..89aaae027
--- /dev/null
+++ b/changes/changes-1.5.4.md
@@ -0,0 +1,5 @@
+# Change Log
+---
+
+- [fix: fix not load application.yml bug & fix guava version conflict bug.](https://github.com/Tencent/spring-cloud-tencent/pull/286)
+- [fix:add junit test in config module.](https://github.com/Tencent/spring-cloud-tencent/pull/288)
diff --git a/pom.xml b/pom.xml
index e7a76b45b..b42f9ccf7 100644
--- a/pom.xml
+++ b/pom.xml
@@ -86,7 +86,7 @@
- 1.5.4-Greenwich.SR6
+ 1.5.5-Greenwich.SR6
Greenwich.SR6
diff --git a/spring-cloud-starter-tencent-polaris-circuitbreaker/src/main/java/com/tencent/cloud/polaris/circuitbreaker/feign/PolarisFeignClient.java b/spring-cloud-starter-tencent-polaris-circuitbreaker/src/main/java/com/tencent/cloud/polaris/circuitbreaker/feign/PolarisFeignClient.java
index dc49566f2..9af0f730b 100644
--- a/spring-cloud-starter-tencent-polaris-circuitbreaker/src/main/java/com/tencent/cloud/polaris/circuitbreaker/feign/PolarisFeignClient.java
+++ b/spring-cloud-starter-tencent-polaris-circuitbreaker/src/main/java/com/tencent/cloud/polaris/circuitbreaker/feign/PolarisFeignClient.java
@@ -34,6 +34,7 @@ import org.apache.commons.lang.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
+import static com.tencent.cloud.common.constant.MetadataConstant.HeaderName.PEER_SERVICE;
import static feign.Util.checkNotNull;
/**
@@ -82,20 +83,25 @@ public class PolarisFeignClient implements Client {
ServiceCallResult resultRequest = new ServiceCallResult();
resultRequest.setNamespace(MetadataContext.LOCAL_NAMESPACE);
- String serviceName = request.requestTemplate().feignTarget().name();
- resultRequest.setService(serviceName);
- URI uri = URI.create(request.url());
- resultRequest.setMethod(uri.getPath());
- resultRequest.setRetStatus(RetStatus.RetSuccess);
- String sourceNamespace = MetadataContext.LOCAL_NAMESPACE;
- String sourceService = MetadataContext.LOCAL_SERVICE;
- if (StringUtils.isNotBlank(sourceNamespace) && StringUtils.isNotBlank(sourceService)) {
- resultRequest.setCallerService(new ServiceKey(sourceNamespace, sourceService));
- }
- resultRequest.setHost(uri.getHost());
- resultRequest.setPort(uri.getPort());
+ Object[] headers = request.headers().get(PEER_SERVICE).toArray();
+ int headersLength = headers.length;
+ if (headersLength != 0) {
+ String serviceName = (String) headers[headersLength - 1];
+ resultRequest.setService(serviceName);
+ URI uri = URI.create(request.url());
+ resultRequest.setMethod(uri.getPath());
+ resultRequest.setRetStatus(RetStatus.RetSuccess);
+ String sourceNamespace = MetadataContext.LOCAL_NAMESPACE;
+ String sourceService = MetadataContext.LOCAL_SERVICE;
+ if (StringUtils.isNotBlank(sourceNamespace) && StringUtils.isNotBlank(sourceService)) {
+ resultRequest.setCallerService(new ServiceKey(sourceNamespace, sourceService));
+ }
+ resultRequest.setHost(uri.getHost());
+ resultRequest.setPort(uri.getPort());
- return resultRequest;
+ return resultRequest;
+ }
+ return null;
}
}
diff --git a/spring-cloud-starter-tencent-polaris-circuitbreaker/src/main/java/com/tencent/cloud/polaris/circuitbreaker/feign/PolarisLoadBalancerFeignClient.java b/spring-cloud-starter-tencent-polaris-circuitbreaker/src/main/java/com/tencent/cloud/polaris/circuitbreaker/feign/PolarisLoadBalancerFeignClient.java
index 92a5ca674..b460e1d0a 100644
--- a/spring-cloud-starter-tencent-polaris-circuitbreaker/src/main/java/com/tencent/cloud/polaris/circuitbreaker/feign/PolarisLoadBalancerFeignClient.java
+++ b/spring-cloud-starter-tencent-polaris-circuitbreaker/src/main/java/com/tencent/cloud/polaris/circuitbreaker/feign/PolarisLoadBalancerFeignClient.java
@@ -17,12 +17,23 @@
package com.tencent.cloud.polaris.circuitbreaker.feign;
+import java.io.IOException;
+import java.net.URI;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.Map;
+
import feign.Client;
+import feign.Request;
+import feign.Response;
import org.springframework.cloud.netflix.ribbon.SpringClientFactory;
import org.springframework.cloud.openfeign.ribbon.CachingSpringLoadBalancerFactory;
import org.springframework.cloud.openfeign.ribbon.LoadBalancerFeignClient;
+import static com.tencent.cloud.common.constant.MetadataConstant.HeaderName.PEER_SERVICE;
+
/**
* Wrap for {@link LoadBalancerFeignClient}.
*
@@ -35,4 +46,12 @@ public class PolarisLoadBalancerFeignClient extends LoadBalancerFeignClient {
SpringClientFactory clientFactory) {
super(delegate, lbClientFactory, clientFactory);
}
+
+ @Override
+ public Response execute(Request request, Request.Options options) throws IOException {
+ Map> headers = new HashMap<>(request.headers());
+ headers.put(PEER_SERVICE, Collections.singletonList(URI.create(request.url()).getAuthority()));
+ request = Request.create(request.httpMethod(), request.url(), headers, request.requestBody());
+ return super.execute(request, options);
+ }
}
diff --git a/spring-cloud-tencent-dependencies/pom.xml b/spring-cloud-tencent-dependencies/pom.xml
index 2a0a0dcad..e4c2fa15f 100644
--- a/spring-cloud-tencent-dependencies/pom.xml
+++ b/spring-cloud-tencent-dependencies/pom.xml
@@ -70,14 +70,13 @@
- 1.5.4-Greenwich.SR6
+ 1.5.5-Greenwich.SR6
1.6.2
1.2.7
23.0
1.4.5
- 2.2.6.RELEASE
4.5.1
1.12.10
31.0.1-jre
@@ -97,14 +96,6 @@
import
-
- org.springframework.cloud
- spring-cloud-openfeign-dependencies
- ${openfeign.version}
- pom
- import
-
-
com.ecwid.consul
consul-api
diff --git a/spring-cloud-tencent-examples/polaris-circuitbreaker-example/polaris-circuitbreaker-example-a/src/main/resources/bootstrap.yml b/spring-cloud-tencent-examples/polaris-circuitbreaker-example/polaris-circuitbreaker-example-a/src/main/resources/bootstrap.yml
index 0a36a8df7..a84448b16 100644
--- a/spring-cloud-tencent-examples/polaris-circuitbreaker-example/polaris-circuitbreaker-example-a/src/main/resources/bootstrap.yml
+++ b/spring-cloud-tencent-examples/polaris-circuitbreaker-example/polaris-circuitbreaker-example-a/src/main/resources/bootstrap.yml
@@ -5,7 +5,7 @@ spring:
name: polaris-circuitbreaker-example-a
cloud:
polaris:
- address: grpc://183.47.111.80:8091
+ address: grpc://9.135.8.246:8091
namespace: default
enabled: true
circuitbreaker:
diff --git a/spring-cloud-tencent-examples/polaris-circuitbreaker-example/polaris-circuitbreaker-example-b/src/main/resources/bootstrap.yml b/spring-cloud-tencent-examples/polaris-circuitbreaker-example/polaris-circuitbreaker-example-b/src/main/resources/bootstrap.yml
index 4aba50500..b80546fbd 100644
--- a/spring-cloud-tencent-examples/polaris-circuitbreaker-example/polaris-circuitbreaker-example-b/src/main/resources/bootstrap.yml
+++ b/spring-cloud-tencent-examples/polaris-circuitbreaker-example/polaris-circuitbreaker-example-b/src/main/resources/bootstrap.yml
@@ -5,7 +5,7 @@ spring:
name: polaris-circuitbreaker-example-b
cloud:
polaris:
- address: grpc://183.47.111.80:8091
+ address: grpc://9.135.8.246:8091
namespace: default
enabled: true
is-throw-runtime-exception: false