feat:Remove error log from `DecodeTransferMetadataReactiveFilter`. (#991)

pull/1000/head
Haotian Zhang 1 year ago committed by GitHub
parent 4fcff95f7b
commit 97f5ec54d0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -2,4 +2,5 @@
--- ---
- [feature: support reactive discovery client health indicator.](https://github.com/Tencent/spring-cloud-tencent/pull/988) - [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) - [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)

@ -21,7 +21,8 @@ README:
## 介绍 ## 介绍
Spring Cloud Tencent 是基于 Spring Cloud SPI 实现的一站式微服务解决方案。通过集成 Spring Cloud 和腾讯中间件,让分布式服务和微服务的开发、测试、发布和运维变得更加简单。 Spring Cloud Tencent 是基于 Spring Cloud SPI 实现的一站式微服务解决方案。通过集成 Spring Cloud
和腾讯中间件,让分布式服务和微服务的开发、测试、发布和运维变得更加简单。
<img src="https://user-images.githubusercontent.com/4991116/170412323-ecaf544c-1d7b-45db-9cf0-591544e50c64.png" width="80%" /> <img src="https://user-images.githubusercontent.com/4991116/170412323-ecaf544c-1d7b-45db-9cf0-591544e50c64.png" width="80%" />
@ -31,7 +32,7 @@ Spring Cloud Tencent 集成 Spring Cloud 和北极星。北极星是一个支持
- [北极星 Github](https://github.com/polarismesh/polaris) - [北极星 Github](https://github.com/polarismesh/polaris)
Spring Cloud 集成北极星可以解决以下问题: Spring Cloud 集成北极星可以解决以下问题:
- 服务管理:服务发现、服务发现、健康检查 - 服务管理:服务发现、服务发现、健康检查
- 流量控制:可自定义的流量路由、负载均衡、限频限流、访问控制 - 流量控制:可自定义的流量路由、负载均衡、限频限流、访问控制
@ -98,10 +99,10 @@ Spring Cloud Tencent 所有组件都已上传到 Maven 中央仓库,只需要
北极星为开发者提供体验环境: 北极星为开发者提供体验环境:
- [北极星控制台](http://14.116.241.63:8080) - [北极星控制台](http://14.22.2.220:80)
- 北极星服务端地址:`grpc://183.47.111.80:8091` - 北极星服务端地址:`grpc://14.22.2.171:8091`
在 spring-cloud-tencent-example 项目里,北极星服务端地址默认配置为`grpc://183.47.111.80:8091`。 在 spring-cloud-tencent-example 项目里,北极星服务端地址默认配置为`grpc://14.22.2.171:8091`。
## 交流群 ## 交流群

@ -21,17 +21,19 @@ Visit [Wiki](https://github.com/Tencent/spring-cloud-tencent/wiki) to learn more
## Introduction ## Introduction
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 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.
<img src="https://user-images.githubusercontent.com/4991116/170412596-692f8dae-42f7-495f-a451-01396e381eb0.png" width="80%" /> <img src="https://user-images.githubusercontent.com/4991116/170412596-692f8dae-42f7-495f-a451-01396e381eb0.png" width="80%" />
**Service discovery and governance** **Service discovery and governance**
Spring Cloud Tencent integrates Spring Cloud with Polaris which is an open source system for service discovery and governance. Spring Cloud Tencent integrates Spring Cloud with Polaris which is an open source system for service discovery and
governance.
- [Polaris Github](https://github.com/polarismesh/polaris) - [Polaris Github](https://github.com/polarismesh/polaris)
Spring Cloud with Polaris can solve these problem: Spring Cloud with Polaris can solve these problem:
- service management: service discovery, service registry and health check - service management: service discovery, service registry and health check
- traffic control: customizable routing, load balance, rate limiting and access control - traffic control: customizable routing, load balance, rate limiting and access control
@ -99,10 +101,10 @@ For example:
The experience environment of Polaris is provided for developers: The experience environment of Polaris is provided for developers:
- [Polaris Console](http://14.116.241.63:8080) - [Polaris Console](http://14.22.2.220:80)
- Polaris Server Address: `grpc://183.47.111.80:8091` - Polaris Server Address: `grpc://14.22.2.171:8091`
The address of Polaris server in spring-cloud-tencent-example is `grpc://183.47.111.80:8091` by default. The address of Polaris server in spring-cloud-tencent-example is `grpc://14.22.2.171:8091` by default.
## Chat Group ## Chat Group

@ -81,8 +81,6 @@ public class DecodeTransferMetadataReactiveFilter implements WebFilter, Ordered
TransHeadersTransfer.transfer(serverHttpRequest); TransHeadersTransfer.transfer(serverHttpRequest);
return webFilterChain.filter(serverWebExchange) return webFilterChain.filter(serverWebExchange)
.doOnError(throwable -> LOG.error("handle metadata[{}] error.",
MetadataContextHolder.get(), throwable))
.doFinally((type) -> MetadataContextHolder.remove()); .doFinally((type) -> MetadataContextHolder.remove());
} }

@ -69,7 +69,7 @@ public class PolarisRegistration implements Registration {
private Map<String, String> metadata; private Map<String, String> metadata;
private String host; private final String host;
private int port; private int port;
@ -133,10 +133,6 @@ public class PolarisRegistration implements Registration {
return port; return port;
} }
protected void setPort(int port) {
this.port = port;
}
@Override @Override
public boolean isSecure() { public boolean isSecure() {
return StringUtils.equalsIgnoreCase(polarisDiscoveryProperties.getProtocol(), "https"); return StringUtils.equalsIgnoreCase(polarisDiscoveryProperties.getProtocol(), "https");

@ -73,7 +73,7 @@
<revision>1.12.0-2022.0.1-SNAPSHOT</revision> <revision>1.12.0-2022.0.1-SNAPSHOT</revision>
<!-- Dependencies --> <!-- Dependencies -->
<polaris.version>1.12.0</polaris.version> <polaris.version>1.12.3</polaris.version>
<guava.version>31.1-jre</guava.version> <guava.version>31.1-jre</guava.version>
<mocktio.version>4.9.0</mocktio.version> <mocktio.version>4.9.0</mocktio.version>
<byte-buddy.version>1.12.19</byte-buddy.version> <byte-buddy.version>1.12.19</byte-buddy.version>

@ -5,7 +5,7 @@ spring:
name: MetadataBackendService name: MetadataBackendService
cloud: cloud:
polaris: polaris:
address: grpc://183.47.111.80:8091 address: grpc://14.22.2.171:8091
namespace: default namespace: default
enabled: true enabled: true
discovery: discovery:

@ -5,7 +5,7 @@ spring:
name: MetadataFrontendService name: MetadataFrontendService
cloud: cloud:
polaris: polaris:
address: grpc://183.47.111.80:8091 address: grpc://14.22.2.171:8091
namespace: default namespace: default
enabled: true enabled: true
discovery: discovery:

@ -5,7 +5,7 @@ spring:
name: MetadataMiddleService name: MetadataMiddleService
cloud: cloud:
polaris: polaris:
address: grpc://183.47.111.80:8091 address: grpc://14.22.2.171:8091
namespace: default namespace: default
enabled: true enabled: true
discovery: discovery:

@ -5,7 +5,7 @@ spring:
name: NacosCalleeService name: NacosCalleeService
cloud: cloud:
polaris: polaris:
address: grpc://183.47.111.80:8091 address: grpc://14.22.2.171:8091
namespace: default namespace: default
enabled: true enabled: true
stat: stat:

@ -5,7 +5,7 @@ spring:
name: NacosCalleeService name: NacosCalleeService
cloud: cloud:
polaris: polaris:
address: grpc://183.47.111.80:8091 address: grpc://14.22.2.171:8091
namespace: default namespace: default
enabled: true enabled: true
stat: stat:

@ -5,7 +5,7 @@ spring:
name: NacosCallerService name: NacosCallerService
cloud: cloud:
polaris: polaris:
address: grpc://183.47.111.80:8091 address: grpc://14.22.2.171:8091
namespace: default namespace: default
enabled: true enabled: true
loadbalancer: loadbalancer:

@ -5,7 +5,7 @@ spring:
name: polaris-circuitbreaker-callee-service name: polaris-circuitbreaker-callee-service
cloud: cloud:
polaris: polaris:
address: grpc://183.47.111.80:8091 address: grpc://14.22.2.171:8091
namespace: default namespace: default
enabled: true enabled: true
stat: stat:

@ -5,7 +5,7 @@ spring:
name: polaris-circuitbreaker-callee-service name: polaris-circuitbreaker-callee-service
cloud: cloud:
polaris: polaris:
address: grpc://183.47.111.80:8091 address: grpc://14.22.2.171:8091
namespace: default namespace: default
enabled: true enabled: true
stat: stat:

@ -8,7 +8,7 @@ spring:
circuitbreaker: circuitbreaker:
enabled: true enabled: true
polaris: polaris:
address: grpc://183.47.111.80:8091 address: grpc://14.22.2.171:8091
namespace: default namespace: default
enabled: true enabled: true
loadbalancer: loadbalancer:

@ -16,7 +16,7 @@ spring:
feature-env: feature-env:
enabled: true enabled: true
polaris: polaris:
address: grpc://183.47.111.80:8091 address: grpc://14.22.2.171:8091
namespace: default namespace: default
enabled: true enabled: true
gateway: gateway:
@ -36,7 +36,7 @@ spring:
name: CircuitBreaker name: CircuitBreaker
args: args:
# statusCodes 缺省时会自动识别 "5**" 为错误 # statusCodes 缺省时会自动识别 "5**" 为错误
# statusCodes: '''404,5**''' # statusCodes: '''404,5**'''
# fallbackUri 缺省时会在熔断触发后拉取 plaris server 配置的降级作为 response # fallbackUri 缺省时会在熔断触发后拉取 plaris server 配置的降级作为 response
fallbackUri: '''forward:/polaris-fallback''' fallbackUri: '''forward:/polaris-fallback'''
# routes: # routes:

@ -5,7 +5,7 @@ spring:
name: polaris-circuitbreaker-resttemplate-example name: polaris-circuitbreaker-resttemplate-example
cloud: cloud:
polaris: polaris:
address: grpc://183.47.111.80:8091 address: grpc://14.22.2.171:8091
namespace: default namespace: default
enabled: true enabled: true
loadbalancer: loadbalancer:

@ -5,7 +5,7 @@ spring:
name: polaris-circuitbreaker-webclient-example name: polaris-circuitbreaker-webclient-example
cloud: cloud:
polaris: polaris:
address: grpc://183.47.111.80:8091 address: grpc://14.22.2.171:8091
namespace: default namespace: default
enabled: true enabled: true
loadbalancer: loadbalancer:

@ -5,7 +5,7 @@ spring:
name: polaris-config-data-example name: polaris-config-data-example
cloud: cloud:
polaris: polaris:
address: grpc://183.47.111.80:8091 address: grpc://14.22.2.171:8091
namespace: default namespace: default
config: config:
auto-refresh: true # auto refresh when config file changed auto-refresh: true # auto refresh when config file changed

@ -7,12 +7,12 @@ spring:
active: abc active: abc
cloud: cloud:
polaris: polaris:
address: grpc://183.47.111.80:8091 address: grpc://14.22.2.171:8091
namespace: default namespace: default
config: config:
auto-refresh: true # auto refresh when config file changed auto-refresh: true # auto refresh when config file changed
# data-source: local # config data source default is polaris. # data-source: local # config data source default is polaris.
# local-file-root-path: # set root path for reading config file, when in local data source # local-file-root-path: # set root path for reading config file, when in local data source
groups: groups:
- name: ${spring.application.name} # group name - name: ${spring.application.name} # group name
files: [ "config/application.properties", "config/bootstrap.yml" ] # config/application.properties takes precedence over config/bootstrap.yml files: [ "config/application.properties", "config/bootstrap.yml" ] # config/application.properties takes precedence over config/bootstrap.yml

@ -5,7 +5,7 @@ spring:
name: DiscoveryCalleeService name: DiscoveryCalleeService
cloud: cloud:
polaris: polaris:
address: grpc://183.47.111.80:8091 address: grpc://14.22.2.171:8091
namespace: default namespace: default
enabled: true enabled: true
discovery: discovery:

@ -13,7 +13,7 @@ spring:
reporter: reporter:
enabled: true enabled: true
polaris: polaris:
address: grpc://183.47.111.80:8091 address: grpc://14.22.2.171:8091
namespace: default namespace: default
enabled: true enabled: true
discovery: discovery:

@ -10,5 +10,5 @@ spring:
content: content:
env: blue env: blue
polaris: polaris:
address: grpc://183.47.111.80:8091 address: grpc://14.22.2.171:8091
namespace: default namespace: default

@ -10,5 +10,5 @@ spring:
content: content:
env: green env: green
polaris: polaris:
address: grpc://183.47.111.80:8091 address: grpc://14.22.2.171:8091
namespace: default namespace: default

@ -21,7 +21,7 @@ spring:
transitive: transitive:
- a - a
polaris: polaris:
address: grpc://183.47.111.80:8091 address: grpc://14.22.2.171:8091
namespace: default namespace: default
enabled: true enabled: true
gateway: gateway:

@ -5,7 +5,7 @@ spring:
name: RateLimitCalleeService name: RateLimitCalleeService
cloud: cloud:
polaris: polaris:
address: grpc://183.47.111.80:8091 address: grpc://14.22.2.171:8091
namespace: default namespace: default
enabled: true enabled: true
ratelimit: ratelimit:

@ -9,6 +9,6 @@ spring:
content: content:
label1: value1 label1: value1
polaris: polaris:
address: grpc://183.47.111.80:8091 address: grpc://14.22.2.171:8091
namespace: default namespace: default
enabled: true enabled: true

@ -9,6 +9,6 @@ spring:
content: content:
label1: value2 label1: value2
polaris: polaris:
address: grpc://183.47.111.80:8091 address: grpc://14.22.2.171:8091
namespace: default namespace: default
enabled: true enabled: true

@ -12,7 +12,7 @@ spring:
reporter: reporter:
enabled: true enabled: true
polaris: polaris:
address: grpc://183.47.111.80:8091 address: grpc://14.22.2.171:8091
namespace: default namespace: default
enabled: true enabled: true
loadbalancer: loadbalancer:

@ -26,7 +26,7 @@
应用默认指向北极星官方的体验环境,启动成功后可直接到体验站点查看服务注册数据。 应用默认指向北极星官方的体验环境,启动成功后可直接到体验站点查看服务注册数据。
- 管控台地址: http://14.116.241.63:8080/ - 管控台地址: http://14.22.2.220:80/
- 账号polaris - 账号polaris
- 密码polaris - 密码polaris
@ -84,7 +84,7 @@ featureenv-front-example[feature2] -> featureenv-middle-example[base] -> feature
**配置染色规则** **配置染色规则**
配置地址http://14.116.241.63:8080/#/filegroup-detail?group=featureenv-gateway&namespace=default 配置地址http://14.22.2.220:80/#/filegroup-detail?group=featureenv-gateway&namespace=default
修改 rule/staining.json 配置文件,填写以下规则: 修改 rule/staining.json 配置文件,填写以下规则:

@ -31,7 +31,7 @@ directly.
By default, the applications point to the official Polaris experience environment, and you can directly view the service By default, the applications point to the official Polaris experience environment, and you can directly view the service
registration data at the experience site after a successful launch. registration data at the experience site after a successful launch.
- Console address: http://14.116.241.63:8080/ - Console address: http://14.22.2.220:80/
- Account: polaris - Account: polaris
- Password: polaris - Password: polaris
@ -89,7 +89,7 @@ Simulate a real-world scenario, assuming that the client request has a uid reque
**Configure coloring rules** **Configure coloring rules**
Polaris Configuration Address: http://14.116.241.63:8080/#/filegroup-detail?group=featureenv-gateway&namespace=default Polaris Configuration Address: http://14.22.2.220:80/#/filegroup-detail?group=featureenv-gateway&namespace=default
Modify the `rule/staining.json` configuration file and fill in the following rule: Modify the `rule/staining.json` configuration file and fill in the following rule:

@ -6,7 +6,7 @@ spring:
name: featureenv-backend-example name: featureenv-backend-example
cloud: cloud:
polaris: polaris:
address: grpc://183.47.111.80:8091 address: grpc://14.22.2.171:8091
namespace: default namespace: default
enabled: true enabled: true
logging: logging:

@ -6,7 +6,7 @@ spring:
name: featureenv-front-example name: featureenv-front-example
cloud: cloud:
polaris: polaris:
address: grpc://183.47.111.80:8091 address: grpc://14.22.2.171:8091
namespace: default namespace: default
enabled: true enabled: true
logging: logging:

@ -6,7 +6,7 @@ spring:
name: featureenv-middle-example name: featureenv-middle-example
cloud: cloud:
polaris: polaris:
address: grpc://183.47.111.80:8091 address: grpc://14.22.2.171:8091
namespace: default namespace: default
enabled: true enabled: true
logging: logging:

@ -6,7 +6,7 @@ spring:
name: featureenv-backend-example name: featureenv-backend-example
cloud: cloud:
polaris: polaris:
address: grpc://183.47.111.80:8091 address: grpc://14.22.2.171:8091
namespace: default namespace: default
enabled: true enabled: true
tencent: tencent:

@ -6,7 +6,7 @@ spring:
name: featureenv-middle-example name: featureenv-middle-example
cloud: cloud:
polaris: polaris:
address: grpc://183.47.111.80:8091 address: grpc://14.22.2.171:8091
namespace: default namespace: default
enabled: true enabled: true
tencent: tencent:

@ -6,7 +6,7 @@ spring:
name: featureenv-backend-example name: featureenv-backend-example
cloud: cloud:
polaris: polaris:
address: grpc://183.47.111.80:8091 address: grpc://14.22.2.171:8091
namespace: default namespace: default
enabled: true enabled: true
tencent: tencent:

@ -6,7 +6,7 @@ spring:
name: featureenv-front-example name: featureenv-front-example
cloud: cloud:
polaris: polaris:
address: grpc://183.47.111.80:8091 address: grpc://14.22.2.171:8091
namespace: default namespace: default
enabled: true enabled: true
tencent: tencent:

@ -7,7 +7,7 @@ spring:
cloud: cloud:
tencent: tencent:
plugin: plugin:
scg: scg:
staining: staining:
enabled: true enabled: true
rule-staining: rule-staining:
@ -16,7 +16,7 @@ spring:
feature-env: feature-env:
enabled: true enabled: true
polaris: polaris:
address: grpc://183.47.111.80:8091 address: grpc://14.22.2.171:8091
namespace: default namespace: default
enabled: true enabled: true
gateway: gateway:

@ -6,7 +6,7 @@ spring:
name: gray-release-back name: gray-release-back
cloud: cloud:
polaris: polaris:
address: grpc://183.47.111.80:8091 address: grpc://14.22.2.171:8091
namespace: default namespace: default
enabled: true enabled: true
logging: logging:

@ -6,7 +6,7 @@ spring:
name: gray-release-front name: gray-release-front
cloud: cloud:
polaris: polaris:
address: grpc://183.47.111.80:8091 address: grpc://14.22.2.171:8091
namespace: default namespace: default
enabled: true enabled: true
logging: logging:

@ -6,7 +6,7 @@ spring:
name: gray-release-gateway name: gray-release-gateway
cloud: cloud:
polaris: polaris:
address: grpc://183.47.111.80:8091 address: grpc://14.22.2.171:8091
namespace: default namespace: default
enabled: true enabled: true
logging: logging:

@ -6,7 +6,7 @@ spring:
name: gray-release-middle name: gray-release-middle
cloud: cloud:
polaris: polaris:
address: grpc://183.47.111.80:8091 address: grpc://14.22.2.171:8091
namespace: default namespace: default
enabled: true enabled: true
logging: logging:

@ -5,14 +5,14 @@ spring:
name: QuickstartCalleeService name: QuickstartCalleeService
cloud: cloud:
polaris: polaris:
address: grpc://183.47.111.80:8091 address: grpc://14.22.2.171:8091
namespace: default namespace: default
enabled: true enabled: true
discovery: discovery:
enabled: true enabled: true
register: true register: true
config: config:
address: grpc://183.47.111.80:8093 address: grpc://14.22.2.171:8093
auto-refresh: true auto-refresh: true
groups: groups:
- name: ${spring.application.name} - name: ${spring.application.name}

@ -5,14 +5,14 @@ spring:
name: QuickstartCalleeService name: QuickstartCalleeService
cloud: cloud:
polaris: polaris:
address: grpc://183.47.111.80:8091 address: grpc://14.22.2.171:8091
namespace: default namespace: default
enabled: true enabled: true
discovery: discovery:
enabled: true enabled: true
register: true register: true
config: config:
address: grpc://183.47.111.80:8093 address: grpc://14.22.2.171:8093
auto-refresh: true auto-refresh: true
groups: groups:
- name: ${spring.application.name} - name: ${spring.application.name}

@ -5,7 +5,7 @@ spring:
name: QuickstartCallerService name: QuickstartCallerService
cloud: cloud:
polaris: polaris:
address: grpc://183.47.111.80:8091 address: grpc://14.22.2.171:8091
namespace: default namespace: default
enabled: true enabled: true
discovery: discovery:

@ -15,7 +15,7 @@ spring:
feature-env: feature-env:
enabled: true enabled: true
polaris: polaris:
address: grpc://183.47.111.80:8091 address: grpc://14.22.2.171:8091
namespace: default namespace: default
enabled: true enabled: true
gateway: gateway:

@ -58,5 +58,6 @@ public class PolarisContextGetHostTest {
assertThat(polarisContextProperties.getEnabled()).isTrue(); assertThat(polarisContextProperties.getEnabled()).isTrue();
assertThat(polarisContextProperties.getNamespace()).isEqualTo("dev"); assertThat(polarisContextProperties.getNamespace()).isEqualTo("dev");
assertThat(polarisContextProperties.getService()).isEqualTo("TestApp"); assertThat(polarisContextProperties.getService()).isEqualTo("TestApp");
assertThat(polarisContextProperties.getLocalPort()).isEqualTo(9090);
} }
} }

@ -6,3 +6,4 @@ spring:
namespace: dev namespace: dev
service: TestApp service: TestApp
enabled: true enabled: true
local-port: 9090

Loading…
Cancel
Save