feat:support Spring Cloud 2023.

pull/1230/head
Haotian Zhang 8 months ago
parent 9b323dacae
commit cb57c3b809

@ -3,6 +3,7 @@ name: Codecov
on:
push:
branches:
- 2023.0
- 2022.0
- 2021.0
- 2020.0
@ -10,6 +11,7 @@ on:
- greenwich
pull_request:
branches:
- 2023.0
- 2022.0
- 2021.0
- 2020.0

@ -6,9 +6,11 @@ name: Test with Junit 2022.0
on:
push:
branches:
- 2023.0
- 2022.0
pull_request:
branches:
- 2023.0
- 2022.0
jobs:

@ -3,6 +3,7 @@ name: License checker
on:
push:
branches:
- 2023.0
- 2022.0
- 2021.0
- 2020.0
@ -10,6 +11,7 @@ on:
- greenwich
pull_request:
branches:
- 2023.0
- 2022.0
- 2021.0
- 2020.0

@ -3,6 +3,7 @@ name: Snapshot
on:
push:
branches:
- 2023.0
- 2022.0
- 2021.0
- 2020.0

@ -1,23 +1,3 @@
# Change Log
---
- [fix: fix the logging problem open at #1189.](https://github.com/Tencent/spring-cloud-tencent/pull/1196)
- [fix:the polaris config relation non-daemon thread should stop when application fails to start.](https://github.com/Tencent/spring-cloud-tencent/pull/1102)
- [Refactoring:remove invalid @AutoConfigureAfter and @AutoConfigureBefore from discovery client automatic configuration.](https://github.com/Tencent/spring-cloud-tencent/pull/1116)
- [fix:fix feign url bug when using sleuth.](https://github.com/Tencent/spring-cloud-tencent/pull/1120)
- [refactor:optimize the order and condition matching of service registration automatic configuration.](https://github.com/Tencent/spring-cloud-tencent/pull/1131)
- [feat:support service contract reporting.](https://github.com/Tencent/spring-cloud-tencent/pull/1141)
- [feat: support log path configuration parameters,](https://github.com/Tencent/spring-cloud-tencent/pull/1142)
- [feat:add swagger report switch.](https://github.com/Tencent/spring-cloud-tencent/pull/1150)
- [fix: dynamic routing using cookies.](https://github.com/Tencent/spring-cloud-tencent/pull/1153)
- [fix:fix retry loadbalancer not working bug.](https://github.com/Tencent/spring-cloud-tencent/pull/1155)
- [fix:fix header validation when using Chinese char.](https://github.com/Tencent/spring-cloud-tencent/pull/1169)
- [feat: add circuit breaker actuator.](https://github.com/Tencent/spring-cloud-tencent/pull/1170)
- [feat: add metadata transfer for http header via spring.cloud.tencent.metadata.headers.](https://github.com/Tencent/spring-cloud-tencent/pull/1176)
- [fix:remove bcprov-jdk15on dependency.](https://github.com/Tencent/spring-cloud-tencent/pull/1180)
- [feat:support configuration encryption.](https://github.com/Tencent/spring-cloud-tencent/pull/1184)
- [feat:optimize examples.](https://github.com/Tencent/spring-cloud-tencent/pull/1188)
- [feat: support nacos namespace mapping](https://github.com/Tencent/spring-cloud-tencent/pull/1190)
- [fix:fix rule-based router when using RestTemplate.](https://github.com/Tencent/spring-cloud-tencent/pull/1202)
- [fix:fix sct-all wrong spring boot version obtain.](https://github.com/Tencent/spring-cloud-tencent/pull/1206)
- [fix:fix reporter wrong initialization when using config data.](https://github.com/Tencent/spring-cloud-tencent/pull/1220)

@ -5,8 +5,8 @@
[![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)
[![Test with Junit 2022.0](https://github.com/Tencent/spring-cloud-tencent/actions/workflows/junit_test17.yml/badge.svg?branch=2022.0)](https://github.com/Tencent/spring-cloud-tencent/actions/workflows/junit_test17.yml)
[![codecov.io](https://codecov.io/gh/Tencent/spring-cloud-tencent/branch/2022.0/graph/badge.svg)](https://codecov.io/gh/Tencent/spring-cloud-tencent?branch=2022.0)
[![Test with Junit](https://github.com/Tencent/spring-cloud-tencent/actions/workflows/junit_test17.yml/badge.svg?branch=2023.0)](https://github.com/Tencent/spring-cloud-tencent/actions/workflows/junit_test17.yml)
[![codecov.io](https://codecov.io/gh/Tencent/spring-cloud-tencent/branch/2023.0/graph/badge.svg)](https://codecov.io/gh/Tencent/spring-cloud-tencent?branch=2023.0)
[English](./README.md) | 简体中文
@ -61,7 +61,7 @@ Spring Cloud Tencent 所有组件都已上传到 Maven 中央仓库,只需要
> 注意:
>
> 支持Spring Cloud 版本2022.0、2021.0、2020.0、Hoxton。
> 支持Spring Cloud 版本2023.0、2022.0、2021.0、2020.0、Hoxton。
>
> Spring Cloud Tencent
> 的版本列表可以查看

@ -5,8 +5,8 @@
[![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)
[![Test with Junit 2022.0](https://github.com/Tencent/spring-cloud-tencent/actions/workflows/junit_test17.yml/badge.svg?branch=2022.0)](https://github.com/Tencent/spring-cloud-tencent/actions/workflows/junit_test17.yml)
[![codecov.io](https://codecov.io/gh/Tencent/spring-cloud-tencent/branch/2022.0/graph/badge.svg)](https://codecov.io/gh/Tencent/spring-cloud-tencent?branch=2022.0)
[![Test with Junit](https://github.com/Tencent/spring-cloud-tencent/actions/workflows/junit_test17.yml/badge.svg?branch=2023.0)](https://github.com/Tencent/spring-cloud-tencent/actions/workflows/junit_test17.yml)
[![codecov.io](https://codecov.io/gh/Tencent/spring-cloud-tencent/branch/2023.0/graph/badge.svg)](https://codecov.io/gh/Tencent/spring-cloud-tencent?branch=2023.0)
English | [简体中文](./README-zh.md)
@ -63,7 +63,7 @@ dependencies.
> Notice:
>
> Support Spring Cloud 2022.0, 2021.0, 2020.0, Hoxton.
> Support Spring Cloud 2023.0, 2022.0, 2021.0, 2020.0, Hoxton.
>
> The version list of Spring Cloud Tencent can be found
> in

@ -1,19 +0,0 @@
# Change Log
---
- [docs:Add code coverage blocking.](https://github.com/Tencent/spring-cloud-tencent/pull/838)
- [docs:Add license checker GitHub Action.](https://github.com/Tencent/spring-cloud-tencent/pull/840)
- [refactor:move loadbalancer to discovery module.](https://github.com/Tencent/spring-cloud-tencent/pull/846)
- [feat:update spring framework version of 2022 branch.](https://github.com/Tencent/spring-cloud-tencent/pull/851)
- [feature:add PolarisRateLimiterLimitedFallback spi.](https://github.com/Tencent/spring-cloud-tencent/pull/857)
- [fix:fix the error capture of rate limit exception.](https://github.com/Tencent/spring-cloud-tencent/pull/860)
- [feat:enable stat reporting as default.](https://github.com/Tencent/spring-cloud-tencent/pull/863)
- [refactor:update to junit 5.](https://github.com/Tencent/spring-cloud-tencent/pull/866)
- [docs:support auto snapshot release in GitHub Action.](https://github.com/Tencent/spring-cloud-tencent/pull/871)
- [feature:add User-Agent:polaris for healthyCheck api.](https://github.com/Tencent/spring-cloud-tencent/pull/872)
- [optimize:optimize ServiceRuleManager.](https://github.com/Tencent/spring-cloud-tencent/pull/877)
- [refactor:refactor stat module.](https://github.com/Tencent/spring-cloud-tencent/pull/880)
- [feature:add polaris circuit breaker support.](https://github.com/Tencent/spring-cloud-tencent/pull/882)
- [fix:fix NPE.](https://github.com/Tencent/spring-cloud-tencent/pull/886)
- [refactor:optimize sct-all.](https://github.com/Tencent/spring-cloud-tencent/pull/888)
- [fix:fix instance circuit breaker not working bug.](https://github.com/Tencent/spring-cloud-tencent/pull/893)

@ -1,13 +0,0 @@
# Change Log
---
- [fix: fix log feign response stream close bug.](https://github.com/Tencent/spring-cloud-tencent/pull/898)
- [fix:remove the secondary report.](https://github.com/Tencent/spring-cloud-tencent/pull/901)
- [feature: add ratelimit provider info and refactor ratelimit use arguments.](https://github.com/Tencent/spring-cloud-tencent/pull/904)
- [fix:optimize instance circuit beaker.](https://github.com/Tencent/spring-cloud-tencent/pull/910)
- [fix:optimize multi service registration and discovery.](https://github.com/Tencent/spring-cloud-tencent/pull/915)
- [feature: improve circuit breaker usage.](https://github.com/Tencent/spring-cloud-tencent/pull/917)
- [fix:fix nacos and consul registration.](https://github.com/Tencent/spring-cloud-tencent/pull/922)
- [Documentation content changes: add circuitbreaker readme.](https://github.com/Tencent/spring-cloud-tencent/pull/931)
- [fix: fix PolarisRouterServiceInstanceListSupplier npe with reactive feign.](https://github.com/Tencent/spring-cloud-tencent/pull/927)
- [fix: adapt for nacos instance.](https://github.com/Tencent/spring-cloud-tencent/pull/936)

@ -1,11 +0,0 @@
# Change Log
---
- [feature: optimize polaris-discovery-example/discovery-callee-service, add client-ip return.](https://github.com/Tencent/spring-cloud-tencent/pull/940)
- [docs:prevent the release of the final version of the sdk.](https://github.com/Tencent/spring-cloud-tencent/pull/944)
- [feat:support webclient and gateway report call metrics](https://github.com/Tencent/spring-cloud-tencent/pull/946)
- [fix: fix nacos CircuitBreaker disable bug.](https://github.com/Tencent/spring-cloud-tencent/pull/949)
- [feature: add config for customized local port.](https://github.com/Tencent/spring-cloud-tencent/pull/957)
- [refactor:refactor reactor code in router module.](https://github.com/Tencent/spring-cloud-tencent/pull/959)
- [refactor: refactor circuitbreaker .](https://github.com/Tencent/spring-cloud-tencent/pull/964)
- [feature: add polaris ring hash load balancer .](https://github.com/Tencent/spring-cloud-tencent/pull/971)

@ -1,4 +0,0 @@
# Change Log
---
- [fix: custom spi metadata loaded bug.](https://github.com/Tencent/spring-cloud-tencent/pull/974)

@ -1,31 +0,0 @@
# Change Log
---
- [feature: support reactive discovery client health indicator.](https://github.com/Tencent/spring-cloud-tencent/pull/988)
- [feature: Enhance default configuration to support `application*.yaml` and `bootstrap*.yaml`.](https://github.com/Tencent/spring-cloud-tencent/pull/988)
- [feat:Remove error log from `DecodeTransferMetadataReactiveFilter`.](https://github.com/Tencent/spring-cloud-tencent/pull/991)
- [Feature: add AssemblyFlow to support tsf.](https://github.com/Tencent/spring-cloud-tencent/pull/992)
- [feat:refactor SDKContext as static.](https://github.com/Tencent/spring-cloud-tencent/pull/995)
- [Refactoring: Refactor Circuitbreaker ut.](https://github.com/Tencent/spring-cloud-tencent/pull/996)
- [fix:fix random port read bug.](https://github.com/Tencent/spring-cloud-tencent/pull/1000)
- [docs:add release GitHub Action.](https://github.com/Tencent/spring-cloud-tencent/pull/1007)
- [docs:update Polaris test environment ip.](https://github.com/Tencent/spring-cloud-tencent/pull/1012)
- [fix:fix custom fallback exception.](https://github.com/Tencent/spring-cloud-tencent/pull/1022)
- [feat: sct-all package is now available as a shaded uber-jar.](https://github.com/Tencent/spring-cloud-tencent/pull/1025)
- [fix:use path parameter in `@FeignClient` for circuit-breaker.](https://github.com/Tencent/spring-cloud-tencent/pull/1028)
- [build(deps): bump guava in /spring-cloud-tencent-dependencies](https://github.com/Tencent/spring-cloud-tencent/pull/1037)
- [fix:fix reporting bug when port is -1.](https://github.com/Tencent/spring-cloud-tencent/pull/1040)
- [fix:update guava version.](https://github.com/Tencent/spring-cloud-tencent/pull/1043)
- [fix:fix circuit breaker bean load order bug when using Nacos discovery.](https://github.com/Tencent/spring-cloud-tencent/pull/1050)
- [refactor:refactor Polaris registration.](https://github.com/Tencent/spring-cloud-tencent/pull/1057)
- [feat:added automatic optimization for dynamic config refresh type.](https://github.com/Tencent/spring-cloud-tencent/pull/1058)
- [fix:fix SCG report wrong service bug when using IP routing.](https://github.com/Tencent/spring-cloud-tencent/pull/1065)
- [fix:fix gray release examples bug.](https://github.com/Tencent/spring-cloud-tencent/pull/1068)
- [fix:fix router label feign interceptor order.](https://github.com/Tencent/spring-cloud-tencent/pull/1071)
- [feat:added polaris weighted round robin load balancer.](https://github.com/Tencent/spring-cloud-tencent/pull/1073)
- [fix:add deregister judgment.](https://github.com/Tencent/spring-cloud-tencent/pull/1075)
- [refactor:optimize discovery properties initialization.](https://github.com/Tencent/spring-cloud-tencent/pull/1079)
- [fix:upgrade spring version.](https://github.com/Tencent/spring-cloud-tencent/pull/1085)
- [fix:Update README-zh.md](https://github.com/Tencent/spring-cloud-tencent/pull/1094).
- [feature: support Polaris configuration center extension plugin interface and support dynamic modification of log levels.](https://github.com/Tencent/spring-cloud-tencent/pull/1105)
- fix:fix system env variable read bug.

@ -5,7 +5,7 @@
<parent>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-build</artifactId>
<version>4.0.5</version>
<version>4.1.0</version>
<relativePath/>
</parent>
<modelVersion>4.0.0</modelVersion>
@ -16,7 +16,7 @@
<version>${revision}</version>
<name>Spring Cloud Tencent</name>
<description>Spring Cloud Tencent</description>
<url>https://github.com/Tencent/spring-cloud-tencent/tree/2022.0</url>
<url>https://github.com/Tencent/spring-cloud-tencent/tree/2023.0</url>
<organization>
<name>Tencent</name>
@ -26,7 +26,7 @@
<licenses>
<license>
<name>The BSD 3-Clause License (BSD3)</name>
<url>https://raw.githubusercontent.com/Tencent/spring-cloud-tencent/2022.0/LICENSE</url>
<url>https://raw.githubusercontent.com/Tencent/spring-cloud-tencent/2023.0/LICENSE</url>
<distribution>repo</distribution>
</license>
</licenses>
@ -89,16 +89,16 @@
<properties>
<!-- Project revision -->
<revision>1.13.0-2022.0.4</revision>
<revision>1.13.0-2023.0.0-SNAPSHOT</revision>
<!-- Spring Framework -->
<spring.framework.version>6.0.16</spring.framework.version>
<spring.framework.version>6.1.3</spring.framework.version>
<!-- Spring Boot -->
<spring.boot.version>3.1.7</spring.boot.version>
<spring.boot.version>3.2.2</spring.boot.version>
<!-- Spring Cloud -->
<spring.cloud.version>2022.0.4</spring.cloud.version>
<spring.cloud.version>2023.0.0</spring.cloud.version>
<!-- Maven Plugin Versions -->
<jacoco.version>0.8.8</jacoco.version>
@ -113,6 +113,14 @@
<dependencyManagement>
<dependencies>
<!-- This will be deleted later with the version upgrade of Spring Cloud. https://github.com/spring-cloud/spring-cloud-commons/issues/1315 -->
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-commons</artifactId>
<version>4.1.1</version>
<scope>compile</scope>
</dependency>
<!-- Spring Cloud Tencent Dependencies -->
<dependency>
<groupId>com.tencent.cloud</groupId>

@ -27,7 +27,6 @@ import java.util.Optional;
import java.util.Set;
import java.util.stream.Collectors;
import com.tencent.cloud.common.metadata.MetadataContextHolder;
import com.tencent.cloud.polaris.context.ServiceRuleManager;
import com.tencent.cloud.polaris.ratelimit.spi.PolarisRateLimiterLabelReactiveResolver;
@ -78,29 +77,35 @@ public class RateLimitRuleArgumentReactiveResolver {
switch (matchArgument.getType()) {
case CUSTOM:
argument = StringUtils.isBlank(matchKey) ? null :
Argument.buildCustom(matchKey, Optional.ofNullable(getCustomResolvedLabels(request).get(matchKey)).orElse(StringUtils.EMPTY));
Argument.buildCustom(matchKey, Optional.ofNullable(getCustomResolvedLabels(request).get(matchKey))
.orElse(StringUtils.EMPTY));
break;
case METHOD:
argument = Argument.buildMethod(request.getRequest().getMethodValue());
argument = Argument.buildMethod(request.getRequest().getMethod().name());
break;
case HEADER:
argument = StringUtils.isBlank(matchKey) ? null :
Argument.buildHeader(matchKey, Optional.ofNullable(request.getRequest().getHeaders().getFirst(matchKey)).orElse(StringUtils.EMPTY));
Argument.buildHeader(matchKey, Optional.ofNullable(request.getRequest().getHeaders()
.getFirst(matchKey)).orElse(StringUtils.EMPTY));
break;
case QUERY:
argument = StringUtils.isBlank(matchKey) ? null :
Argument.buildQuery(matchKey, Optional.ofNullable(request.getRequest().getQueryParams().getFirst(matchKey)).orElse(StringUtils.EMPTY));
Argument.buildQuery(matchKey, Optional.ofNullable(request.getRequest().getQueryParams()
.getFirst(matchKey)).orElse(StringUtils.EMPTY));
break;
case CALLER_SERVICE:
String sourceServiceNamespace = MetadataContextHolder.getDisposableMetadata(DEFAULT_METADATA_SOURCE_SERVICE_NAMESPACE, true).orElse(StringUtils.EMPTY);
String sourceServiceName = MetadataContextHolder.getDisposableMetadata(DEFAULT_METADATA_SOURCE_SERVICE_NAME, true).orElse(StringUtils.EMPTY);
String sourceServiceNamespace = MetadataContextHolder.getDisposableMetadata(DEFAULT_METADATA_SOURCE_SERVICE_NAMESPACE, true)
.orElse(StringUtils.EMPTY);
String sourceServiceName = MetadataContextHolder.getDisposableMetadata(DEFAULT_METADATA_SOURCE_SERVICE_NAME, true)
.orElse(StringUtils.EMPTY);
if (!StringUtils.isEmpty(sourceServiceNamespace) && !StringUtils.isEmpty(sourceServiceName)) {
argument = Argument.buildCallerService(sourceServiceNamespace, sourceServiceName);
}
break;
case CALLER_IP:
InetSocketAddress remoteAddress = request.getRequest().getRemoteAddress();
argument = Argument.buildCallerIP(remoteAddress != null ? remoteAddress.getAddress().getHostAddress() : StringUtils.EMPTY);
argument = Argument.buildCallerIP(remoteAddress != null ? remoteAddress.getAddress()
.getHostAddress() : StringUtils.EMPTY);
break;
default:
break;

@ -75,7 +75,7 @@ public final class SpringWebExpressionLabelUtils {
labels.put(labelKey, getCookieValue(exchange.getRequest(), cookieKey));
}
else if (ExpressionLabelUtils.isMethodLabel(labelKey)) {
labels.put(labelKey, exchange.getRequest().getMethodValue());
labels.put(labelKey, exchange.getRequest().getMethod().name());
}
else if (ExpressionLabelUtils.isUriLabel(labelKey)) {
labels.put(labelKey, exchange.getRequest().getURI().getPath());
@ -118,7 +118,7 @@ public final class SpringWebExpressionLabelUtils {
labels.put(labelKey, getCookieValue(request, cookieKey));
}
else if (ExpressionLabelUtils.isMethodLabel(labelKey)) {
labels.put(labelKey, request.getMethodValue());
labels.put(labelKey, request.getMethod().name());
}
else if (ExpressionLabelUtils.isUriLabel(labelKey)) {
labels.put(labelKey, request.getURI().getPath());

@ -5,7 +5,7 @@
<parent>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-dependencies-parent</artifactId>
<version>4.0.5</version>
<version>4.1.0</version>
<relativePath/>
</parent>
<modelVersion>4.0.0</modelVersion>
@ -16,7 +16,7 @@
<packaging>pom</packaging>
<name>Spring Cloud Tencent Dependencies</name>
<description>Spring Cloud Tencent Dependencies</description>
<url>https://github.com/Tencent/spring-cloud-tencent/tree/2022.0</url>
<url>https://github.com/Tencent/spring-cloud-tencent/tree/2023.0</url>
<organization>
<name>Tencent</name>
@ -26,7 +26,7 @@
<licenses>
<license>
<name>The BSD 3-Clause License (BSD3)</name>
<url>https://raw.githubusercontent.com/Tencent/spring-cloud-tencent/2022.0/LICENSE</url>
<url>https://raw.githubusercontent.com/Tencent/spring-cloud-tencent/2023.0/LICENSE</url>
<distribution>repo</distribution>
</license>
</licenses>
@ -70,7 +70,7 @@
</developers>
<properties>
<revision>1.13.0-2022.0.4</revision>
<revision>1.13.0-2023.0.0-SNAPSHOT</revision>
<!-- Dependencies -->
<polaris.version>1.15.0</polaris.version>
@ -79,7 +79,7 @@
<mocktio.version>4.9.0</mocktio.version>
<byte-buddy.version>1.12.19</byte-buddy.version>
<protobuf-java.version>3.21.7</protobuf-java.version>
<okio.version>3.0.0</okio.version>
<okio.version>3.7.0</okio.version>
<system-stubs-jupiter.version>2.0.2</system-stubs-jupiter.version>
<!-- Maven Plugin Versions -->

Loading…
Cancel
Save