feat:support spring cloud 2024.

pull/1584/head
Haotian Zhang 3 months ago
parent 4612bb92e1
commit fd35059fbb

@ -10,6 +10,7 @@ on:
- 2020
- hoxton
- greenwich
- release/*
pull_request:
branches:
- 2024
@ -19,6 +20,7 @@ on:
- 2020
- hoxton
- greenwich
- release/*
jobs:
set-jdks:

@ -10,6 +10,7 @@ on:
- 2020
- hoxton
- greenwich
- release/*
pull_request:
branches:
- 2024
@ -19,6 +20,7 @@ on:
- 2020
- hoxton
- greenwich
- release/*
jobs:
check-license:
runs-on: ubuntu-latest

@ -10,6 +10,7 @@ on:
- 2020
- hoxton
- greenwich
- release/*
jobs:
check-snapshot:

@ -1,62 +1,4 @@
# Change Log
---
- [fix: fix RouterLabelRestTemplateInterceptor add response headers exception with httpclient5.](https://github.com/Tencent/spring-cloud-tencent/pull/1239)
- [feat: support lossless online and offline](https://github.com/Tencent/spring-cloud-tencent/pull/1254)
- [feat: support lane router](https://github.com/Tencent/spring-cloud-tencent/pull/1256)
- [feat: add lane router examples](https://github.com/Tencent/spring-cloud-tencent/pull/1260)
- [feat:upgrade jackson version.](https://github.com/Tencent/spring-cloud-tencent/pull/1262)
- [fix: fix the lossless provider override in multiple registries scenario](https://github.com/Tencent/spring-cloud-tencent/pull/1263)
- [refactor:let the configuration SDK context stand alone.](https://github.com/Tencent/spring-cloud-tencent/pull/1266)
- [fix:fix nearby router properties loading bug.](https://github.com/Tencent/spring-cloud-tencent/pull/1272)
- [fix: fix grammar issues for lane router example & optimize the gateway dependency](https://github.com/Tencent/spring-cloud-tencent/pull/1274)
- [fix: fix lossless deregister failed when no healthcheck configured](https://github.com/Tencent/spring-cloud-tencent/pull/1279)
- [fix:fix ApplicationContextAwareUtils NPE bug.](https://github.com/Tencent/spring-cloud-tencent/pull/1297)
- [feat:upgrade jacoco version.](https://github.com/Tencent/spring-cloud-tencent/pull/1310)
- [fix:fix no registry when lossless is disabled.](https://github.com/Tencent/spring-cloud-tencent/pull/1312)
- [fix:fix the ratelimit bug for 2023](https://github.com/Tencent/spring-cloud-tencent/pull/1316)
- [fix:update spring boot version](https://github.com/Tencent/spring-cloud-tencent/pull/1333)
- [feat:add scg-mvc example](https://github.com/Tencent/spring-cloud-tencent/pull/1367)
- [feat:add zero protection.](https://github.com/Tencent/spring-cloud-tencent/pull/1408)
- [feat:add Tencent Cloud TSF support.](https://github.com/Tencent/spring-cloud-tencent/pull/1409)
- [feat:support consul config.](https://github.com/Tencent/spring-cloud-tencent/pull/1410)
- [feat:add trace report support.](https://github.com/Tencent/spring-cloud-tencent/pull/1411)
- [fix: fix lossless test case unstable issues.](https://github.com/Tencent/spring-cloud-tencent/pull/1412)
- [feat:support consul service update task.](https://github.com/Tencent/spring-cloud-tencent/pull/1413)
- [fix:fix app starting failed when user using custom OpenAPI bean.](https://github.com/Tencent/spring-cloud-tencent/pull/1414)
- [fix: move ConditionalOnTsfEnabled to spring-cloud-tencent-commons and fix PolarisInetUtilsAutoConfiguration.](https://github.com/Tencent/spring-cloud-tencent/pull/1415)
- [fix: memory cost too many when using wildcard feign calls](https://github.com/Tencent/spring-cloud-tencent/pull/1416)
- [feat:support consul config data. ](https://github.com/Tencent/spring-cloud-tencent/pull/1417)
- [feat: support otel trace](https://github.com/Tencent/spring-cloud-tencent/pull/1419)
- [feat:support TSF router.](https://github.com/Tencent/spring-cloud-tencent/pull/1420)
- [feat:upgrade nearby router and add namespace nearby router.](https://github.com/Tencent/spring-cloud-tencent/pull/1421)
- [fix:fix contract reporting bug when using TSF.](https://github.com/Tencent/spring-cloud-tencent/pull/1422)
- [fix: fix TSF context bootstrap configuration](https://github.com/Tencent/spring-cloud-tencent/pull/1424)
- [fix: fix PolarisCircuitBreakerConfiguration not clear when gateway invoke by wildcard apis](https://github.com/Tencent/spring-cloud-tencent/pull/1426)
- [fix:fix actuator name warning from #1428 .](https://github.com/Tencent/spring-cloud-tencent/pull/1431)
- [feat:upgrade api circuit breaker.](https://github.com/Tencent/spring-cloud-tencent/pull/1442)
- [feat: support lossless config from console & support warmup.](https://github.com/Tencent/spring-cloud-tencent/pull/1445)
- [feat:add admin http handler.](https://github.com/Tencent/spring-cloud-tencent/pull/1450)
- [feat:upgrade spring cloud 2023 version.](https://github.com/Tencent/spring-cloud-tencent/pull/1451)
- [feat:support concurrency rate limit.](https://github.com/Tencent/spring-cloud-tencent/pull/1455)
- [feat:support auth.](https://github.com/Tencent/spring-cloud-tencent/pull/1479)
- [feat:upgrade trace plugin.](https://github.com/Tencent/spring-cloud-tencent/pull/1480)
- [feat:support smooth upgrade from tsf.](https://github.com/Tencent/spring-cloud-tencent/pull/1482)
- [fix:fix caller disposable metadata handle when using tracing.](https://github.com/Tencent/spring-cloud-tencent/pull/1483)
- [refactor:update registry status.](https://github.com/Tencent/spring-cloud-tencent/pull/1484)
- [feat:support polaris route for gateway mvc.](https://github.com/Tencent/spring-cloud-tencent/pull/1493)
- [feat: implement circuit breaker in enhance plugin, support listen config group, support refresh single config in refresh_context mode.](https://github.com/Tencent/spring-cloud-tencent/pull/1501)
- [feat:support polaris event.](https://github.com/Tencent/spring-cloud-tencent/pull/1502)
- [feat:support circuit breaker metrics reporting.](https://github.com/Tencent/spring-cloud-tencent/pull/1503)
- [feat: support gateway context, feign eager-load support default value.](https://github.com/Tencent/spring-cloud-tencent/pull/1504)
- [feat:use polaris-all for shading third-party dependencies.](https://github.com/Tencent/spring-cloud-tencent/pull/1505)
- [feat:support default instance circuit breaker rule.](https://github.com/Tencent/spring-cloud-tencent/pull/1506)
- [docs:update JDK version configuration in GitHub Actions.](https://github.com/Tencent/spring-cloud-tencent/pull/1507)
- [fix: fix count circuit breaker in gateway & return 404 when context api does not match.](https://github.com/Tencent/spring-cloud-tencent/pull/1509)
- [fix:fix watch tsf config, fix bean refresh with RefreshScope and ConfigurationProperties.](https://github.com/Tencent/spring-cloud-tencent/pull/1512)
- [docs:simplify GitHub Actions.](https://github.com/Tencent/spring-cloud-tencent/pull/1513)
- [feat: support config event.](https://github.com/Tencent/spring-cloud-tencent/pull/1535)
- [feat:support stat and event report with service discovery.](https://github.com/Tencent/spring-cloud-tencent/pull/1537)
- [fix: update EnhancedRequestContext toString method.](https://github.com/Tencent/spring-cloud-tencent/pull/1546)
- [docs: update GitHub Actions.](https://github.com/Tencent/spring-cloud-tencent/pull/1556)
- [fix: fix javaagent ratelimit pb method not found error](https://github.com/Tencent/spring-cloud-tencent/pull/1569)
- feat:support spring cloud 2024.

@ -6,7 +6,7 @@
[![License](https://img.shields.io/badge/License-BSD%203--Clause-blue.svg)](https://opensource.org/licenses/BSD-3-Clause)
[![Test with Junit](https://github.com/Tencent/spring-cloud-tencent/actions/workflows/junit_test17.yml/badge.svg?branch=2023)](https://github.com/Tencent/spring-cloud-tencent/actions/workflows/junit_test17.yml)
[![codecov.io](https://codecov.io/gh/Tencent/spring-cloud-tencent/branch/2023/graph/badge.svg)](https://codecov.io/gh/Tencent/spring-cloud-tencent?branch=2023)
[![codecov.io](https://codecov.io/gh/Tencent/spring-cloud-tencent/branch/2023/graph/badge.svg)](https://codecov.io/gh/Tencent/spring-cloud-tencent?branch=2024)
[English](./README.md) | 简体中文
@ -60,9 +60,6 @@ Spring Cloud 集成北极星可以解决以下问题:
Spring Cloud Tencent 所有组件都已上传到 Maven 中央仓库,只需要引入依赖即可。
> 注意:
>
> 支持Spring Cloud 版本2023、2022、2021、2020、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)

@ -6,7 +6,7 @@
[![License](https://img.shields.io/badge/License-BSD%203--Clause-blue.svg)](https://opensource.org/licenses/BSD-3-Clause)
[![Junit Test](https://github.com/Tencent/spring-cloud-tencent/actions/workflows/junit.yml/badge.svg?branch=2023)](https://github.com/Tencent/spring-cloud-tencent/actions/workflows/junit.yml)
[![codecov.io](https://codecov.io/gh/Tencent/spring-cloud-tencent/branch/2023/graph/badge.svg)](https://codecov.io/gh/Tencent/spring-cloud-tencent?branch=2023)
[![codecov.io](https://codecov.io/gh/Tencent/spring-cloud-tencent/branch/2023/graph/badge.svg)](https://codecov.io/gh/Tencent/spring-cloud-tencent?branch=2024)
English | [简体中文](./README-zh.md)
@ -62,9 +62,6 @@ All the components of Spring Cloud Tencent have been uploaded to the Maven centr
dependencies.
> Notice:
>
> Support Spring Cloud 2023, 2022, 2021, 2020, 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)

@ -1,4 +0,0 @@
# Change Log
---
- fix:fix NullPointerException when properties contain kv with null value.

@ -1,4 +0,0 @@
# Change Log
---
[fix: fix RouterLabelRestTemplateInterceptor add response headers exception with httpclient5.](https://github.com/Tencent/spring-cloud-tencent/pull/1239)

@ -5,7 +5,7 @@
<parent>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-build</artifactId>
<version>4.1.3</version>
<version>4.2.1</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/2023</url>
<url>https://github.com/Tencent/spring-cloud-tencent/tree/2024</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/2023/LICENSE</url>
<url>https://raw.githubusercontent.com/Tencent/spring-cloud-tencent/2024/LICENSE</url>
<distribution>repo</distribution>
</license>
</licenses>
@ -90,16 +90,16 @@
<properties>
<!-- Project revision -->
<revision>2.0.1.0-2023.0.3-SNAPSHOT</revision>
<revision>2.0.2.0-2024.0.1-SNAPSHOT</revision>
<!-- Spring Framework -->
<spring.framework.version>6.1.14</spring.framework.version>
<spring.framework.version>6.2.7</spring.framework.version>
<!-- Spring Boot -->
<spring.boot.version>3.3.5</spring.boot.version>
<spring.boot.version>3.4.5</spring.boot.version>
<!-- Spring Cloud -->
<spring.cloud.version>2023.0.3</spring.cloud.version>
<spring.cloud.version>2024.0.1</spring.cloud.version>
<!-- Maven Plugin Versions -->
<jacoco.version>0.8.12</jacoco.version>

@ -26,14 +26,15 @@ import com.tencent.polaris.api.pojo.CircuitBreakerStatus;
import org.springframework.http.HttpHeaders;
import org.springframework.http.HttpStatus;
import org.springframework.http.client.AbstractClientHttpResponse;
import org.springframework.http.HttpStatusCode;
import org.springframework.http.client.ClientHttpResponse;
/**
* PolarisCircuitBreakerHttpResponse.
*
* @author sean yu
*/
public class PolarisCircuitBreakerHttpResponse extends AbstractClientHttpResponse {
public class PolarisCircuitBreakerHttpResponse implements ClientHttpResponse {
private final CircuitBreakerStatus.FallbackInfo fallbackInfo;
@ -64,13 +65,13 @@ public class PolarisCircuitBreakerHttpResponse extends AbstractClientHttpRespons
}
@Override
public final int getRawStatusCode() {
return fallbackInfo.getCode();
public HttpStatusCode getStatusCode() {
return HttpStatus.valueOf(fallbackInfo.getCode());
}
@Override
public final String getStatusText() {
HttpStatus status = HttpStatus.resolve(getRawStatusCode());
HttpStatus status = HttpStatus.resolve(getStatusCode().value());
return (status != null ? status.getReasonPhrase() : "");
}

@ -17,6 +17,7 @@
package com.tencent.cloud.polaris.circuitbreaker.instrument.resttemplate;
import java.io.IOException;
import java.io.InputStream;
import java.util.HashMap;
import java.util.Map;
@ -35,7 +36,7 @@ import org.mockito.junit.jupiter.MockitoExtension;
@ExtendWith(MockitoExtension.class)
public class PolarisCircuitBreakerHttpResponseTest {
@Test
void testConstructorWithCodeOnly() {
void testConstructorWithCodeOnly() throws IOException {
PolarisCircuitBreakerHttpResponse response = new PolarisCircuitBreakerHttpResponse(200);
Assertions.assertEquals(200, response.getRawStatusCode());
@ -45,7 +46,7 @@ public class PolarisCircuitBreakerHttpResponseTest {
}
@Test
void testConstructorWithCodeAndBody() {
void testConstructorWithCodeAndBody() throws IOException {
String body = "test body";
PolarisCircuitBreakerHttpResponse response = new PolarisCircuitBreakerHttpResponse(200, body);
@ -56,7 +57,7 @@ public class PolarisCircuitBreakerHttpResponseTest {
}
@Test
void testConstructorWithCodeHeadersAndBody() {
void testConstructorWithCodeHeadersAndBody() throws IOException {
String body = "test body";
Map<String, String> headers = new HashMap<>();
headers.put("Content-Type", "application/json");
@ -73,7 +74,7 @@ public class PolarisCircuitBreakerHttpResponseTest {
}
@Test
void testConstructorWithFallbackInfo() {
void testConstructorWithFallbackInfo() throws IOException {
Map<String, String> headers = new HashMap<>();
headers.put("Content-Type", "application/json");
CircuitBreakerStatus.FallbackInfo fallbackInfo = new CircuitBreakerStatus.FallbackInfo(200, headers, "test body");
@ -96,7 +97,8 @@ public class PolarisCircuitBreakerHttpResponseTest {
@Test
void testGetStatusTextWithInvalidHttpStatus() {
PolarisCircuitBreakerHttpResponse response = new PolarisCircuitBreakerHttpResponse(999);
Assertions.assertEquals("", response.getStatusText());
//SCT 2024 will throw IllegalArgumentException when getStatusText() is called with invalid http status code
Assertions.assertThrows(IllegalArgumentException.class, () -> response.getStatusText());
}
@Test

@ -18,6 +18,8 @@
package com.tencent.cloud.polaris.router.instrument.resttemplate;
import java.net.URI;
import java.util.HashMap;
import java.util.Map;
import com.tencent.cloud.common.constant.OrderConstant;
import com.tencent.cloud.common.metadata.MetadataContextHolder;
@ -110,6 +112,11 @@ public class RouterLabelRestTemplateInterceptorTest {
return uri;
}
@Override
public Map<String, Object> getAttributes() {
return new HashMap<>();
}
@Override
public HttpHeaders getHeaders() {
return httpHeaders;

@ -5,7 +5,7 @@
<parent>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-dependencies-parent</artifactId>
<version>4.1.3</version>
<version>4.2.1</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/2023</url>
<url>https://github.com/Tencent/spring-cloud-tencent/tree/2024</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/2023/LICENSE</url>
<url>https://raw.githubusercontent.com/Tencent/spring-cloud-tencent/2024/LICENSE</url>
<distribution>repo</distribution>
</license>
</licenses>
@ -71,10 +71,10 @@
<properties>
<!-- Project revision -->
<revision>2.0.1.0-2023.0.3-SNAPSHOT</revision>
<revision>2.0.2.0-2024.0.1-SNAPSHOT</revision>
<!-- Polaris SDK version -->
<polaris.version>2.0.1.0-SNAPSHOT</polaris.version>
<polaris.version>2.0.1.0</polaris.version>
<!-- Dependencies -->
<springdoc.version>2.2.0</springdoc.version>

@ -23,7 +23,7 @@ import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
@FeignClient(name = "provider-demo")
@FeignClient(name = "${provider.name:provider-demo}")
public interface ProviderDemoService {
@RequestMapping(value = "/echo/{str}", method = RequestMethod.GET)
String echo(@PathVariable("str") String str);

Loading…
Cancel
Save