From 8ab8fc1cd2d2d9859626c2e4210be5390620f5ed Mon Sep 17 00:00:00 2001 From: "Yong.Teng" Date: Fri, 29 Jul 2022 14:19:52 +0800 Subject: [PATCH 1/5] =?UTF-8?q?=E7=89=88=E6=9C=AC=E5=8D=87=E7=BA=A7?= =?UTF-8?q?=E8=87=B3=202.0.3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGELOG.md | 17 +++++++++++++++++ buession-springcloud-common/pom.xml | 7 ++++++- buession-springcloud-config-client/pom.xml | 7 ++++++- buession-springcloud-config-server/pom.xml | 7 ++++++- buession-springcloud-consul/pom.xml | 7 ++++++- buession-springcloud-feign/pom.xml | 9 +++++++-- buession-springcloud-gateway/pom.xml | 7 ++++++- buession-springcloud-hystrix/pom.xml | 9 +++++++-- buession-springcloud-kubernetes/pom.xml | 7 ++++++- buession-springcloud-metrics/pom.xml | 7 ++++++- .../pom.xml | 7 ++++++- buession-springcloud-nacos-discovery/pom.xml | 7 ++++++- buession-springcloud-parent/pom.xml | 17 ++++++++++++----- buession-springcloud-ribbon/pom.xml | 9 +++++++-- buession-springcloud-stream/pom.xml | 7 ++++++- buession-springcloud-zuul/pom.xml | 7 ++++++- 16 files changed, 116 insertions(+), 22 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9e8bb12..307178e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,17 @@ =========================== +## [2.0.3](https://github.com/buession/buession-springcloud/releases/tag/v2.0.3) (2022-07-xx) + +### 🔨依赖升级 + +- [依赖库版本升级和安全漏洞修复](https://github.com/buession/buession-parent/releases/tag/v2.0.3) +- [openfeign] 版本升级至 11.9.1 + + +--- + + ## [2.0.2](https://github.com/buession/buession-springcloud/releases/tag/v2.0.2) (2022-07-28) ### 🔨依赖升级 @@ -9,6 +20,9 @@ - [依赖库版本升级和安全漏洞修复](https://github.com/buession/buession-parent/releases/tag/v2.0.2) +--- + + ## [2.0.1](https://github.com/buession/buession-springcloud/releases/tag/v2.0.1) (2022-07-18) ### 🔨依赖升级 @@ -18,6 +32,9 @@ - spring-cloud-starter-alibaba-nacos-discovery 版本升级至 2.2.8.RELEASE +--- + + ## [2.0.0](https://github.com/buession/buession-springcloud/releases/tag/v2.0.0) (2022-07-08) ### 🔨依赖升级 diff --git a/buession-springcloud-common/pom.xml b/buession-springcloud-common/pom.xml index 0cf80d8..3fb30f9 100644 --- a/buession-springcloud-common/pom.xml +++ b/buession-springcloud-common/pom.xml @@ -7,7 +7,7 @@ com.buession.springcloud buession-springcloud-parent ../buession-springcloud-parent - 2.0.2 + 2.0.3 buession-springcloud-common https://github.com/buession/buession-springcloud @@ -46,6 +46,11 @@ https://github.com/buession/buession-springcloud + + github + https://github.com/buession/buession-springcloud/issues + + com.buession.springboot diff --git a/buession-springcloud-config-client/pom.xml b/buession-springcloud-config-client/pom.xml index 3ee1ea7..49f3c0b 100644 --- a/buession-springcloud-config-client/pom.xml +++ b/buession-springcloud-config-client/pom.xml @@ -7,7 +7,7 @@ com.buession.springcloud buession-springcloud-parent ../buession-springcloud-parent - 2.0.2 + 2.0.3 buession-springcloud-config-client https://github.com/buession/buession-springcloud @@ -46,6 +46,11 @@ https://github.com/buession/buession-springcloud + + github + https://github.com/buession/buession-springcloud/issues + + com.buession.springcloud diff --git a/buession-springcloud-config-server/pom.xml b/buession-springcloud-config-server/pom.xml index 5076d63..8cf537d 100644 --- a/buession-springcloud-config-server/pom.xml +++ b/buession-springcloud-config-server/pom.xml @@ -7,7 +7,7 @@ com.buession.springcloud buession-springcloud-parent ../buession-springcloud-parent - 2.0.2 + 2.0.3 buession-springcloud-config-server https://github.com/buession/buession-springcloud @@ -46,6 +46,11 @@ https://github.com/buession/buession-springcloud + + github + https://github.com/buession/buession-springcloud/issues + + com.buession.springcloud diff --git a/buession-springcloud-consul/pom.xml b/buession-springcloud-consul/pom.xml index 682dae4..e2d8e24 100644 --- a/buession-springcloud-consul/pom.xml +++ b/buession-springcloud-consul/pom.xml @@ -7,7 +7,7 @@ com.buession.springcloud buession-springcloud-parent ../buession-springcloud-parent - 2.0.2 + 2.0.3 buession-springcloud-consul https://github.com/buession/buession-springcloud @@ -46,6 +46,11 @@ https://github.com/buession/buession-springcloud + + github + https://github.com/buession/buession-springcloud/issues + + com.buession.springcloud diff --git a/buession-springcloud-feign/pom.xml b/buession-springcloud-feign/pom.xml index 1777231..4746608 100644 --- a/buession-springcloud-feign/pom.xml +++ b/buession-springcloud-feign/pom.xml @@ -7,7 +7,7 @@ com.buession.springcloud buession-springcloud-parent ../buession-springcloud-parent - 2.0.2 + 2.0.3 buession-springcloud-feign https://github.com/buession/buession-springcloud @@ -46,8 +46,13 @@ https://github.com/buession/buession-springcloud + + github + https://github.com/buession/buession-springcloud/issues + + - 11.7 + 11.9.1 diff --git a/buession-springcloud-gateway/pom.xml b/buession-springcloud-gateway/pom.xml index 2be1a3d..a178dc6 100644 --- a/buession-springcloud-gateway/pom.xml +++ b/buession-springcloud-gateway/pom.xml @@ -7,7 +7,7 @@ com.buession.springcloud buession-springcloud-parent ../buession-springcloud-parent - 2.0.2 + 2.0.3 buession-springcloud-gateway https://github.com/buession/buession-springcloud @@ -46,6 +46,11 @@ https://github.com/buession/buession-springcloud + + github + https://github.com/buession/buession-springcloud/issues + + com.buession.springcloud diff --git a/buession-springcloud-hystrix/pom.xml b/buession-springcloud-hystrix/pom.xml index b216fdf..b39161f 100644 --- a/buession-springcloud-hystrix/pom.xml +++ b/buession-springcloud-hystrix/pom.xml @@ -7,7 +7,7 @@ com.buession.springcloud buession-springcloud-parent ../buession-springcloud-parent - 2.0.2 + 2.0.3 buession-springcloud-hystrix https://github.com/buession/buession-springcloud @@ -46,6 +46,11 @@ https://github.com/buession/buession-springcloud + + github + https://github.com/buession/buession-springcloud/issues + + com.buession.springcloud @@ -56,7 +61,7 @@ org.springframework.cloud spring-cloud-starter-netflix-hystrix - 2.2.10.RELEASE + ${springcloud.netflix.version} diff --git a/buession-springcloud-kubernetes/pom.xml b/buession-springcloud-kubernetes/pom.xml index 0b89590..43597f5 100644 --- a/buession-springcloud-kubernetes/pom.xml +++ b/buession-springcloud-kubernetes/pom.xml @@ -7,7 +7,7 @@ com.buession.springcloud buession-springcloud-parent ../buession-springcloud-parent - 2.0.2 + 2.0.3 buession-springcloud-kubernetes https://github.com/buession/buession-springcloud @@ -46,6 +46,11 @@ https://github.com/buession/buession-springcloud + + github + https://github.com/buession/buession-springcloud/issues + + 1.1.10.RELEASE diff --git a/buession-springcloud-metrics/pom.xml b/buession-springcloud-metrics/pom.xml index 3fe0aaf..653e0af 100644 --- a/buession-springcloud-metrics/pom.xml +++ b/buession-springcloud-metrics/pom.xml @@ -7,7 +7,7 @@ com.buession.springcloud buession-springcloud-parent ../buession-springcloud-parent - 2.0.2 + 2.0.3 buession-springcloud-metrics https://github.com/buession/buession-springcloud @@ -46,6 +46,11 @@ https://github.com/buession/buession-springcloud + + github + https://github.com/buession/buession-springcloud/issues + + com.buession.springcloud diff --git a/buession-springcloud-nacos-config-client/pom.xml b/buession-springcloud-nacos-config-client/pom.xml index cdd163b..321a73c 100644 --- a/buession-springcloud-nacos-config-client/pom.xml +++ b/buession-springcloud-nacos-config-client/pom.xml @@ -7,7 +7,7 @@ com.buession.springcloud buession-springcloud-parent ../buession-springcloud-parent - 2.0.2 + 2.0.3 buession-springcloud-nacos-config-client https://github.com/buession/buession-springcloud @@ -46,6 +46,11 @@ https://github.com/buession/buession-springcloud + + github + https://github.com/buession/buession-springcloud/issues + + com.buession.springcloud diff --git a/buession-springcloud-nacos-discovery/pom.xml b/buession-springcloud-nacos-discovery/pom.xml index 62dd4e0..73b4fef 100644 --- a/buession-springcloud-nacos-discovery/pom.xml +++ b/buession-springcloud-nacos-discovery/pom.xml @@ -7,7 +7,7 @@ com.buession.springcloud buession-springcloud-parent ../buession-springcloud-parent - 2.0.2 + 2.0.3 buession-springcloud-nacos-discovery https://github.com/buession/buession-springcloud @@ -46,6 +46,11 @@ https://github.com/buession/buession-springcloud + + github + https://github.com/buession/buession-springcloud/issues + + com.buession.springcloud diff --git a/buession-springcloud-parent/pom.xml b/buession-springcloud-parent/pom.xml index 0091902..7fe0584 100644 --- a/buession-springcloud-parent/pom.xml +++ b/buession-springcloud-parent/pom.xml @@ -7,13 +7,13 @@ com.buession parent - 2.0.2 + 2.0.3 com.buession.springcloud buession-springcloud-parent https://github.com/buession/buession-springcloud - Buession Springcloud Framework Parent - 2.0.2 + Buession SpringCloud Framework Parent + 2.0.3 pom @@ -48,6 +48,11 @@ https://github.com/buession/buession-springcloud + + github + https://github.com/buession/buession-springcloud/issues + + ../buession-springcloud-common ../buession-springcloud-config-client @@ -66,7 +71,9 @@ + 2.2.9.RELEASE 2.2.8.RELEASE + 2.2.10.RELEASE 2.2.8.RELEASE @@ -93,7 +100,7 @@ org.springframework.cloud spring-cloud-commons - 2.2.9.RELEASE + ${springcloud.base.version} ch.qos.logback @@ -104,7 +111,7 @@ org.springframework.cloud spring-cloud-context - 2.2.9.RELEASE + ${springcloud.base.version} ch.qos.logback diff --git a/buession-springcloud-ribbon/pom.xml b/buession-springcloud-ribbon/pom.xml index 6ac6b08..31b3649 100644 --- a/buession-springcloud-ribbon/pom.xml +++ b/buession-springcloud-ribbon/pom.xml @@ -7,7 +7,7 @@ com.buession.springcloud buession-springcloud-parent ../buession-springcloud-parent - 2.0.2 + 2.0.3 buession-springcloud-ribbon https://github.com/buession/buession-springcloud @@ -46,6 +46,11 @@ https://github.com/buession/buession-springcloud + + github + https://github.com/buession/buession-springcloud/issues + + com.buession.springcloud @@ -56,7 +61,7 @@ org.springframework.cloud spring-cloud-starter-netflix-ribbon - 2.2.10.RELEASE + ${springcloud.netflix.version} org.springframework.boot diff --git a/buession-springcloud-stream/pom.xml b/buession-springcloud-stream/pom.xml index 1340730..6582398 100644 --- a/buession-springcloud-stream/pom.xml +++ b/buession-springcloud-stream/pom.xml @@ -7,7 +7,7 @@ com.buession.springcloud buession-springcloud-parent ../buession-springcloud-parent - 2.0.2 + 2.0.3 buession-springcloud-stream https://github.com/buession/buession-springcloud @@ -46,6 +46,11 @@ https://github.com/buession/buession-springcloud + + github + https://github.com/buession/buession-springcloud/issues + + com.buession.springcloud diff --git a/buession-springcloud-zuul/pom.xml b/buession-springcloud-zuul/pom.xml index 6f49669..42827bc 100644 --- a/buession-springcloud-zuul/pom.xml +++ b/buession-springcloud-zuul/pom.xml @@ -7,7 +7,7 @@ com.buession.springcloud buession-springcloud-parent ../buession-springcloud-parent - 2.0.2 + 2.0.3 buession-springcloud-zuul https://github.com/buession/buession-springcloud @@ -46,6 +46,11 @@ https://github.com/buession/buession-springcloud + + github + https://github.com/buession/buession-springcloud/issues + + com.buession.springcloud From 8741c2a1fcb7cc1ea0276a3b35ee975012dcb987 Mon Sep 17 00:00:00 2001 From: "Yong.Teng" Date: Wed, 3 Aug 2022 13:06:07 +0800 Subject: [PATCH 2/5] =?UTF-8?q?=E7=89=88=E6=9C=AC=E5=8D=87=E7=BA=A7?= =?UTF-8?q?=E8=87=B3=202.1.0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGELOG.md | 4 ++-- buession-springcloud-common/pom.xml | 2 +- buession-springcloud-config-client/pom.xml | 2 +- buession-springcloud-config-server/pom.xml | 2 +- buession-springcloud-consul/pom.xml | 2 +- buession-springcloud-feign/pom.xml | 2 +- buession-springcloud-gateway/pom.xml | 2 +- buession-springcloud-hystrix/pom.xml | 2 +- buession-springcloud-kubernetes/pom.xml | 2 +- buession-springcloud-metrics/pom.xml | 2 +- buession-springcloud-nacos-config-client/pom.xml | 2 +- buession-springcloud-nacos-discovery/pom.xml | 2 +- buession-springcloud-parent/pom.xml | 4 ++-- buession-springcloud-ribbon/pom.xml | 2 +- buession-springcloud-stream/pom.xml | 2 +- buession-springcloud-zuul/pom.xml | 2 +- 16 files changed, 18 insertions(+), 18 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 307178e..c2dfbc9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,11 +2,11 @@ =========================== -## [2.0.3](https://github.com/buession/buession-springcloud/releases/tag/v2.0.3) (2022-07-xx) +## [2.1.0](https://github.com/buession/buession-springcloud/releases/tag/v2.1.0) (2022-07-xx) ### 🔨依赖升级 -- [依赖库版本升级和安全漏洞修复](https://github.com/buession/buession-parent/releases/tag/v2.0.3) +- [依赖库版本升级和安全漏洞修复](https://github.com/buession/buession-parent/releases/tag/v2.1.0) - [openfeign] 版本升级至 11.9.1 diff --git a/buession-springcloud-common/pom.xml b/buession-springcloud-common/pom.xml index 3fb30f9..fec77e7 100644 --- a/buession-springcloud-common/pom.xml +++ b/buession-springcloud-common/pom.xml @@ -7,7 +7,7 @@ com.buession.springcloud buession-springcloud-parent ../buession-springcloud-parent - 2.0.3 + 2.1.0 buession-springcloud-common https://github.com/buession/buession-springcloud diff --git a/buession-springcloud-config-client/pom.xml b/buession-springcloud-config-client/pom.xml index 49f3c0b..05ea462 100644 --- a/buession-springcloud-config-client/pom.xml +++ b/buession-springcloud-config-client/pom.xml @@ -7,7 +7,7 @@ com.buession.springcloud buession-springcloud-parent ../buession-springcloud-parent - 2.0.3 + 2.1.0 buession-springcloud-config-client https://github.com/buession/buession-springcloud diff --git a/buession-springcloud-config-server/pom.xml b/buession-springcloud-config-server/pom.xml index 8cf537d..6a580a7 100644 --- a/buession-springcloud-config-server/pom.xml +++ b/buession-springcloud-config-server/pom.xml @@ -7,7 +7,7 @@ com.buession.springcloud buession-springcloud-parent ../buession-springcloud-parent - 2.0.3 + 2.1.0 buession-springcloud-config-server https://github.com/buession/buession-springcloud diff --git a/buession-springcloud-consul/pom.xml b/buession-springcloud-consul/pom.xml index e2d8e24..8edc6bd 100644 --- a/buession-springcloud-consul/pom.xml +++ b/buession-springcloud-consul/pom.xml @@ -7,7 +7,7 @@ com.buession.springcloud buession-springcloud-parent ../buession-springcloud-parent - 2.0.3 + 2.1.0 buession-springcloud-consul https://github.com/buession/buession-springcloud diff --git a/buession-springcloud-feign/pom.xml b/buession-springcloud-feign/pom.xml index 4746608..ed72477 100644 --- a/buession-springcloud-feign/pom.xml +++ b/buession-springcloud-feign/pom.xml @@ -7,7 +7,7 @@ com.buession.springcloud buession-springcloud-parent ../buession-springcloud-parent - 2.0.3 + 2.1.0 buession-springcloud-feign https://github.com/buession/buession-springcloud diff --git a/buession-springcloud-gateway/pom.xml b/buession-springcloud-gateway/pom.xml index a178dc6..b37b68d 100644 --- a/buession-springcloud-gateway/pom.xml +++ b/buession-springcloud-gateway/pom.xml @@ -7,7 +7,7 @@ com.buession.springcloud buession-springcloud-parent ../buession-springcloud-parent - 2.0.3 + 2.1.0 buession-springcloud-gateway https://github.com/buession/buession-springcloud diff --git a/buession-springcloud-hystrix/pom.xml b/buession-springcloud-hystrix/pom.xml index b39161f..14cff93 100644 --- a/buession-springcloud-hystrix/pom.xml +++ b/buession-springcloud-hystrix/pom.xml @@ -7,7 +7,7 @@ com.buession.springcloud buession-springcloud-parent ../buession-springcloud-parent - 2.0.3 + 2.1.0 buession-springcloud-hystrix https://github.com/buession/buession-springcloud diff --git a/buession-springcloud-kubernetes/pom.xml b/buession-springcloud-kubernetes/pom.xml index 43597f5..2463002 100644 --- a/buession-springcloud-kubernetes/pom.xml +++ b/buession-springcloud-kubernetes/pom.xml @@ -7,7 +7,7 @@ com.buession.springcloud buession-springcloud-parent ../buession-springcloud-parent - 2.0.3 + 2.1.0 buession-springcloud-kubernetes https://github.com/buession/buession-springcloud diff --git a/buession-springcloud-metrics/pom.xml b/buession-springcloud-metrics/pom.xml index 653e0af..599edbf 100644 --- a/buession-springcloud-metrics/pom.xml +++ b/buession-springcloud-metrics/pom.xml @@ -7,7 +7,7 @@ com.buession.springcloud buession-springcloud-parent ../buession-springcloud-parent - 2.0.3 + 2.1.0 buession-springcloud-metrics https://github.com/buession/buession-springcloud diff --git a/buession-springcloud-nacos-config-client/pom.xml b/buession-springcloud-nacos-config-client/pom.xml index 321a73c..c237cff 100644 --- a/buession-springcloud-nacos-config-client/pom.xml +++ b/buession-springcloud-nacos-config-client/pom.xml @@ -7,7 +7,7 @@ com.buession.springcloud buession-springcloud-parent ../buession-springcloud-parent - 2.0.3 + 2.1.0 buession-springcloud-nacos-config-client https://github.com/buession/buession-springcloud diff --git a/buession-springcloud-nacos-discovery/pom.xml b/buession-springcloud-nacos-discovery/pom.xml index 73b4fef..076c4c8 100644 --- a/buession-springcloud-nacos-discovery/pom.xml +++ b/buession-springcloud-nacos-discovery/pom.xml @@ -7,7 +7,7 @@ com.buession.springcloud buession-springcloud-parent ../buession-springcloud-parent - 2.0.3 + 2.1.0 buession-springcloud-nacos-discovery https://github.com/buession/buession-springcloud diff --git a/buession-springcloud-parent/pom.xml b/buession-springcloud-parent/pom.xml index 7fe0584..42e0c5a 100644 --- a/buession-springcloud-parent/pom.xml +++ b/buession-springcloud-parent/pom.xml @@ -7,13 +7,13 @@ com.buession parent - 2.0.3 + 2.1.0 com.buession.springcloud buession-springcloud-parent https://github.com/buession/buession-springcloud Buession SpringCloud Framework Parent - 2.0.3 + 2.1.0 pom diff --git a/buession-springcloud-ribbon/pom.xml b/buession-springcloud-ribbon/pom.xml index 31b3649..7714757 100644 --- a/buession-springcloud-ribbon/pom.xml +++ b/buession-springcloud-ribbon/pom.xml @@ -7,7 +7,7 @@ com.buession.springcloud buession-springcloud-parent ../buession-springcloud-parent - 2.0.3 + 2.1.0 buession-springcloud-ribbon https://github.com/buession/buession-springcloud diff --git a/buession-springcloud-stream/pom.xml b/buession-springcloud-stream/pom.xml index 6582398..b461c8f 100644 --- a/buession-springcloud-stream/pom.xml +++ b/buession-springcloud-stream/pom.xml @@ -7,7 +7,7 @@ com.buession.springcloud buession-springcloud-parent ../buession-springcloud-parent - 2.0.3 + 2.1.0 buession-springcloud-stream https://github.com/buession/buession-springcloud diff --git a/buession-springcloud-zuul/pom.xml b/buession-springcloud-zuul/pom.xml index 42827bc..5315654 100644 --- a/buession-springcloud-zuul/pom.xml +++ b/buession-springcloud-zuul/pom.xml @@ -7,7 +7,7 @@ com.buession.springcloud buession-springcloud-parent ../buession-springcloud-parent - 2.0.3 + 2.1.0 buession-springcloud-zuul https://github.com/buession/buession-springcloud From 72d9677c88ae898def60c98949a6b0aa2082ba9a Mon Sep 17 00:00:00 2001 From: "Yong.Teng" Date: Thu, 4 Aug 2022 23:40:10 +0800 Subject: [PATCH 3/5] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=20buession-springcloud-b?= =?UTF-8?q?us=20&&=20=E4=BC=98=E5=8C=96=E4=BE=9D=E8=B5=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGELOG.md | 5 + buession-springcloud-bus/pom.xml | 138 ++++++++++++++++++ buession-springcloud-common/pom.xml | 22 ++- buession-springcloud-config-client/pom.xml | 25 +--- buession-springcloud-config-server/pom.xml | 21 --- buession-springcloud-consul/pom.xml | 21 --- buession-springcloud-feign/pom.xml | 21 --- buession-springcloud-gateway/pom.xml | 21 --- buession-springcloud-hystrix/pom.xml | 6 + buession-springcloud-kubernetes/pom.xml | 21 --- buession-springcloud-metrics/pom.xml | 6 + .../pom.xml | 21 --- buession-springcloud-nacos-discovery/pom.xml | 21 --- buession-springcloud-parent/pom.xml | 16 ++ buession-springcloud-ribbon/pom.xml | 21 --- buession-springcloud-stream/pom.xml | 18 +-- buession-springcloud-zuul/pom.xml | 21 --- 17 files changed, 204 insertions(+), 221 deletions(-) create mode 100644 buession-springcloud-bus/pom.xml diff --git a/CHANGELOG.md b/CHANGELOG.md index c2dfbc9..9473482 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,11 @@ - [openfeign] 版本升级至 11.9.1 +### ⭐ 新特性 + +- **buession-springcloud-bus:** 新增 buession-springcloud-bus module + + --- diff --git a/buession-springcloud-bus/pom.xml b/buession-springcloud-bus/pom.xml new file mode 100644 index 0000000..30cfebe --- /dev/null +++ b/buession-springcloud-bus/pom.xml @@ -0,0 +1,138 @@ + + + Buession Springcloud Bus + 4.0.0 + + com.buession.springcloud + buession-springcloud-parent + ../buession-springcloud-parent + 2.1.0 + + buession-springcloud-bus + https://github.com/buession/buession-springcloud + Buession Framework Spring Cloud Bus + jar + + + buession.com Inc. + http://www.buession.com/ + + + + + yong.teng + yong.teng + webmaster@buession.com + + Project Manager + Developer + + + + + + + The Apache License, Version 2.0 + http://www.apache.org/licenses/LICENSE-2.0.txt + repo + A business-friendly OSS license + + + + + scm:git:https://github.com/buession/buession-springcloud.git + scm:git:https://github.com/buession/buession-springcloud.git + https://github.com/buession/buession-springcloud + + + + github + https://github.com/buession/buession-springcloud/issues + + + + + com.buession.springcloud + buession-springcloud-common + ${project.version} + + + org.apache.httpcomponents + * + + + + + + org.springframework + spring-messaging + + + + org.springframework.cloud + spring-cloud-bus + 2.2.4.RELEASE + + + org.springframework.cloud + spring-cloud-stream + + + + org.slf4j + slf4j-api + + + + junit + junit + + + + + buession-springcloud-bus + + + org.apache.maven.plugins + maven-compiler-plugin + + + org.apache.maven.plugins + maven-jar-plugin + + + org.apache.maven.plugins + maven-source-plugin + + + org.apache.maven.plugins + maven-javadoc-plugin + + + org.apache.maven.plugins + maven-resources-plugin + + + org.apache.maven.plugins + maven-checkstyle-plugin + + + org.apache.maven.plugins + maven-surefire-plugin + + + org.apache.maven.plugins + maven-release-plugin + + + org.apache.maven.plugins + maven-gpg-plugin + + + org.sonatype.plugins + nexus-staging-maven-plugin + + + + \ No newline at end of file diff --git a/buession-springcloud-common/pom.xml b/buession-springcloud-common/pom.xml index fec77e7..c256668 100644 --- a/buession-springcloud-common/pom.xml +++ b/buession-springcloud-common/pom.xml @@ -66,10 +66,12 @@ spring-cloud-context + org.springframework.retry @@ -77,8 +79,24 @@ - commons-codec - commons-codec + org.apache.httpcomponents + httpcore + + + commons-logging + commons-logging + + + + + org.apache.httpcomponents + httpclient + + + commons-logging + commons-logging + + diff --git a/buession-springcloud-config-client/pom.xml b/buession-springcloud-config-client/pom.xml index 05ea462..8a5291d 100644 --- a/buession-springcloud-config-client/pom.xml +++ b/buession-springcloud-config-client/pom.xml @@ -57,6 +57,11 @@ buession-springcloud-common ${project.version} + + com.buession.springcloud + buession-springcloud-bus + ${project.version} + org.springframework @@ -70,24 +75,8 @@ - org.apache.httpcomponents - httpcore - - - commons-logging - commons-logging - - - - - org.apache.httpcomponents - httpclient - - - commons-logging - commons-logging - - + org.springframework.security + spring-security-crypto diff --git a/buession-springcloud-config-server/pom.xml b/buession-springcloud-config-server/pom.xml index 6a580a7..c9bc120 100644 --- a/buession-springcloud-config-server/pom.xml +++ b/buession-springcloud-config-server/pom.xml @@ -99,27 +99,6 @@ spring-security-crypto - - org.apache.httpcomponents - httpcore - - - commons-logging - commons-logging - - - - - org.apache.httpcomponents - httpclient - - - commons-logging - commons-logging - - - - com.fasterxml.jackson.dataformat jackson-dataformat-yaml diff --git a/buession-springcloud-consul/pom.xml b/buession-springcloud-consul/pom.xml index 8edc6bd..5578058 100644 --- a/buession-springcloud-consul/pom.xml +++ b/buession-springcloud-consul/pom.xml @@ -85,27 +85,6 @@ jakarta.validation-api - - org.apache.httpcomponents - httpcore - - - commons-logging - commons-logging - - - - - org.apache.httpcomponents - httpclient - - - commons-logging - commons-logging - - - - org.hibernate.validator hibernate-validator diff --git a/buession-springcloud-feign/pom.xml b/buession-springcloud-feign/pom.xml index ed72477..81d2cb7 100644 --- a/buession-springcloud-feign/pom.xml +++ b/buession-springcloud-feign/pom.xml @@ -127,27 +127,6 @@ true - - org.apache.httpcomponents - httpcore - - - commons-logging - commons-logging - - - - - org.apache.httpcomponents - httpclient - - - commons-logging - commons-logging - - - - com.google.guava guava diff --git a/buession-springcloud-gateway/pom.xml b/buession-springcloud-gateway/pom.xml index b37b68d..91ce914 100644 --- a/buession-springcloud-gateway/pom.xml +++ b/buession-springcloud-gateway/pom.xml @@ -80,27 +80,6 @@ 2.2.10.RELEASE - - org.apache.httpcomponents - httpcore - - - commons-logging - commons-logging - - - - - org.apache.httpcomponents - httpclient - - - commons-logging - commons-logging - - - - org.hibernate.validator hibernate-validator diff --git a/buession-springcloud-hystrix/pom.xml b/buession-springcloud-hystrix/pom.xml index 14cff93..47b21ff 100644 --- a/buession-springcloud-hystrix/pom.xml +++ b/buession-springcloud-hystrix/pom.xml @@ -56,6 +56,12 @@ com.buession.springcloud buession-springcloud-common ${project.version} + + + org.apache.httpcomponents + * + + diff --git a/buession-springcloud-kubernetes/pom.xml b/buession-springcloud-kubernetes/pom.xml index 2463002..7ccaecb 100644 --- a/buession-springcloud-kubernetes/pom.xml +++ b/buession-springcloud-kubernetes/pom.xml @@ -106,27 +106,6 @@ jakarta.el - - org.apache.httpcomponents - httpcore - - - commons-logging - commons-logging - - - - - org.apache.httpcomponents - httpclient - - - commons-logging - commons-logging - - - - com.squareup.okhttp3 okhttp diff --git a/buession-springcloud-metrics/pom.xml b/buession-springcloud-metrics/pom.xml index 599edbf..d5ffbbb 100644 --- a/buession-springcloud-metrics/pom.xml +++ b/buession-springcloud-metrics/pom.xml @@ -56,6 +56,12 @@ com.buession.springcloud buession-springcloud-common ${project.version} + + + org.apache.httpcomponents + * + + diff --git a/buession-springcloud-nacos-config-client/pom.xml b/buession-springcloud-nacos-config-client/pom.xml index c237cff..9fc5fe2 100644 --- a/buession-springcloud-nacos-config-client/pom.xml +++ b/buession-springcloud-nacos-config-client/pom.xml @@ -70,27 +70,6 @@ - - org.apache.httpcomponents - httpcore - - - commons-logging - commons-logging - - - - - org.apache.httpcomponents - httpclient - - - commons-logging - commons-logging - - - - com.google.code.findbugs jsr305 diff --git a/buession-springcloud-nacos-discovery/pom.xml b/buession-springcloud-nacos-discovery/pom.xml index 076c4c8..9576480 100644 --- a/buession-springcloud-nacos-discovery/pom.xml +++ b/buession-springcloud-nacos-discovery/pom.xml @@ -80,27 +80,6 @@ - - org.apache.httpcomponents - httpcore - - - commons-logging - commons-logging - - - - - org.apache.httpcomponents - httpclient - - - commons-logging - commons-logging - - - - com.google.code.findbugs jsr305 diff --git a/buession-springcloud-parent/pom.xml b/buession-springcloud-parent/pom.xml index 42e0c5a..a752935 100644 --- a/buession-springcloud-parent/pom.xml +++ b/buession-springcloud-parent/pom.xml @@ -55,6 +55,7 @@ ../buession-springcloud-common + ../buession-springcloud-bus ../buession-springcloud-config-client ../buession-springcloud-config-server ../buession-springcloud-consul @@ -124,6 +125,21 @@ spring-cloud-starter-netflix-archaius 2.2.10.RELEASE + + org.springframework.cloud + spring-cloud-stream + 3.0.13.RELEASE + + + org.springframework.boot + spring-boot-starter-validation + + + javax.annotation + javax.annotation-api + + + com.netflix.netflix-commons diff --git a/buession-springcloud-ribbon/pom.xml b/buession-springcloud-ribbon/pom.xml index 7714757..a46b244 100644 --- a/buession-springcloud-ribbon/pom.xml +++ b/buession-springcloud-ribbon/pom.xml @@ -79,27 +79,6 @@ spring-security-rsa - - org.apache.httpcomponents - httpcore - - - commons-logging - commons-logging - - - - - org.apache.httpcomponents - httpclient - - - commons-logging - commons-logging - - - - com.sun.jersey jersey-client diff --git a/buession-springcloud-stream/pom.xml b/buession-springcloud-stream/pom.xml index b461c8f..e33e530 100644 --- a/buession-springcloud-stream/pom.xml +++ b/buession-springcloud-stream/pom.xml @@ -56,28 +56,22 @@ com.buession.springcloud buession-springcloud-common ${project.version} + + + org.apache.httpcomponents + * + + org.springframework spring-messaging - ${springframework.version} org.springframework.cloud spring-cloud-stream - 3.0.13.RELEASE - - - org.springframework.boot - spring-boot-starter-validation - - - javax.annotation - javax.annotation-api - - org.springframework.cloud diff --git a/buession-springcloud-zuul/pom.xml b/buession-springcloud-zuul/pom.xml index 5315654..cd3c8e0 100644 --- a/buession-springcloud-zuul/pom.xml +++ b/buession-springcloud-zuul/pom.xml @@ -85,27 +85,6 @@ jakarta.servlet-api - - org.apache.httpcomponents - httpcore - - - commons-logging - commons-logging - - - - - org.apache.httpcomponents - httpclient - - - commons-logging - commons-logging - - - - org.slf4j slf4j-api From 0c66564fe24951c439c4590a3d0d66b7e7f11747 Mon Sep 17 00:00:00 2001 From: "Yong.Teng" Date: Mon, 8 Aug 2022 16:38:31 +0800 Subject: [PATCH 4/5] =?UTF-8?q?feign=20=E5=8A=9F=E8=83=BD=E5=8D=87?= =?UTF-8?q?=E7=BA=A7=E5=92=8C=20BUG=20=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../FeignInterceptorConfiguration.java | 28 +++- .../feign/autoconfigure/FeignProperties.java | 104 +++++++++++++++ ...stractClientHeadersRequestInterceptor.java | 125 +++++++++++++++++- ...activeClientHeadersRequestInterceptor.java | 50 ++++--- ...ervletClientHeadersRequestInterceptor.java | 49 ++++--- 5 files changed, 314 insertions(+), 42 deletions(-) create mode 100644 buession-springcloud-feign/src/main/java/com/buession/springcloud/feign/autoconfigure/FeignProperties.java diff --git a/buession-springcloud-feign/src/main/java/com/buession/springcloud/feign/autoconfigure/FeignInterceptorConfiguration.java b/buession-springcloud-feign/src/main/java/com/buession/springcloud/feign/autoconfigure/FeignInterceptorConfiguration.java index a671295..0344365 100644 --- a/buession-springcloud-feign/src/main/java/com/buession/springcloud/feign/autoconfigure/FeignInterceptorConfiguration.java +++ b/buession-springcloud-feign/src/main/java/com/buession/springcloud/feign/autoconfigure/FeignInterceptorConfiguration.java @@ -30,6 +30,7 @@ import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; import org.springframework.boot.autoconfigure.condition.ConditionalOnWebApplication; +import org.springframework.boot.context.properties.EnableConfigurationProperties; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; @@ -38,29 +39,50 @@ */ @Configuration(proxyBeanMethods = false) @ConditionalOnProperty(prefix = "spring.cloud.feign", name = "apply-client-request-headers.enabled", havingValue = "true", matchIfMissing = true) +@EnableConfigurationProperties(FeignProperties.class) @ConditionalOnWebApplication public class FeignInterceptorConfiguration { + protected FeignProperties feignProperties; + + public FeignInterceptorConfiguration(FeignProperties feignProperties){ + this.feignProperties = feignProperties; + } + @Configuration(proxyBeanMethods = false) + @EnableConfigurationProperties(FeignProperties.class) @ConditionalOnWebApplication(type = ConditionalOnWebApplication.Type.SERVLET) static class ServletFeignInterceptorConfiguration extends FeignInterceptorConfiguration { + public ServletFeignInterceptorConfiguration(FeignProperties feignProperties){ + super(feignProperties); + } + @Bean @ConditionalOnMissingBean public RequestInterceptor servletClientHeadersRequestInterceptor(){ - return new ServletClientHeadersRequestInterceptor(); + return new ServletClientHeadersRequestInterceptor( + feignProperties.getApplyClientRequestHeaders().getAllowedHeaderNames(), + feignProperties.getApplyClientRequestHeaders().getIgnoreHeaderNames()); } } @Configuration(proxyBeanMethods = false) - @ConditionalOnWebApplication(type = ConditionalOnWebApplication.Type.SERVLET) + @EnableConfigurationProperties(FeignProperties.class) + @ConditionalOnWebApplication(type = ConditionalOnWebApplication.Type.REACTIVE) static class ReactiveFeignInterceptorConfiguration extends FeignInterceptorConfiguration { + public ReactiveFeignInterceptorConfiguration(FeignProperties feignProperties){ + super(feignProperties); + } + @Bean @ConditionalOnMissingBean public RequestInterceptor reactiveClientHeadersRequestInterceptor(){ - return new ReactiveClientHeadersRequestInterceptor(); + return new ReactiveClientHeadersRequestInterceptor( + feignProperties.getApplyClientRequestHeaders().getAllowedHeaderNames(), + feignProperties.getApplyClientRequestHeaders().getIgnoreHeaderNames()); } } diff --git a/buession-springcloud-feign/src/main/java/com/buession/springcloud/feign/autoconfigure/FeignProperties.java b/buession-springcloud-feign/src/main/java/com/buession/springcloud/feign/autoconfigure/FeignProperties.java new file mode 100644 index 0000000..1baa29a --- /dev/null +++ b/buession-springcloud-feign/src/main/java/com/buession/springcloud/feign/autoconfigure/FeignProperties.java @@ -0,0 +1,104 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. + * See the NOTICE file distributed with this work for additional information regarding copyright ownership. + * The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not + * use this file except in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is + * distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and limitations under the License. + * + * ========================================================================================================= + * + * This software consists of voluntary contributions made by many individuals on behalf of the + * Apache Software Foundation. For more information on the Apache Software Foundation, please see + * . + * + * +-------------------------------------------------------------------------------------------------------+ + * | License: http://www.apache.org/licenses/LICENSE-2.0.txt | + * | Author: Yong.Teng | + * | Copyright @ 2013-2022 Buession.com Inc. | + * +-------------------------------------------------------------------------------------------------------+ + */ +package com.buession.springcloud.feign.autoconfigure; + +import com.buession.core.builder.SetBuilder; +import org.springframework.boot.context.properties.ConfigurationProperties; +import org.springframework.boot.context.properties.NestedConfigurationProperty; + +import java.util.Set; + +/** + * @author Yong.Teng + * @since 2.1.0 + */ +@ConfigurationProperties(prefix = "spring.cloud.feign") +public class FeignProperties { + + @NestedConfigurationProperty + private ApplyClientRequestHeaders applyClientRequestHeaders = new ApplyClientRequestHeaders(); + + public ApplyClientRequestHeaders getApplyClientRequestHeaders(){ + return applyClientRequestHeaders; + } + + public void setApplyClientRequestHeaders( + ApplyClientRequestHeaders applyClientRequestHeaders){ + this.applyClientRequestHeaders = applyClientRequestHeaders; + } + + public final static class ApplyClientRequestHeaders { + + /** + * 允许的请求头 + */ + private Set allowedHeaderNames; + + /** + * 忽略的请求头 + */ + private Set ignoreHeaderNames = SetBuilder.of("Accept-Encoding"); + + /** + * 返回允许的请求头 + * + * @return 允许的请求头 + */ + public Set getAllowedHeaderNames(){ + return allowedHeaderNames; + } + + /** + * 设置允许的请求头 + * + * @param allowedHeaderNames + * 允许的请求头 + */ + public void setAllowedHeaderNames(Set allowedHeaderNames){ + this.allowedHeaderNames = allowedHeaderNames; + } + + /** + * 返回忽略的请求头 + * + * @return 忽略的请求头 + */ + public Set getIgnoreHeaderNames(){ + return ignoreHeaderNames; + } + + /** + * 设置忽略的请求头 + * + * @param ignoreHeaderNames + * 忽略的请求头 + */ + public void setIgnoreHeaderNames(Set ignoreHeaderNames){ + this.ignoreHeaderNames = ignoreHeaderNames; + } + + } + +} diff --git a/buession-springcloud-feign/src/main/java/com/buession/springcloud/feign/interceptor/AbstractClientHeadersRequestInterceptor.java b/buession-springcloud-feign/src/main/java/com/buession/springcloud/feign/interceptor/AbstractClientHeadersRequestInterceptor.java index ee69410..5bb811c 100644 --- a/buession-springcloud-feign/src/main/java/com/buession/springcloud/feign/interceptor/AbstractClientHeadersRequestInterceptor.java +++ b/buession-springcloud-feign/src/main/java/com/buession/springcloud/feign/interceptor/AbstractClientHeadersRequestInterceptor.java @@ -24,14 +24,18 @@ */ package com.buession.springcloud.feign.interceptor; -import com.buession.core.builder.ListBuilder; +import com.buession.core.builder.SetBuilder; import com.buession.core.utils.VersionUtils; +import com.buession.core.validator.Validate; import com.buession.springcloud.common.Version; import feign.Feign; import feign.RequestInterceptor; import feign.RequestTemplate; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import java.util.List; +import java.util.Set; /** * 请求头拦截器抽象类 @@ -45,14 +49,129 @@ public abstract class AbstractClientHeadersRequestInterceptor implements Request protected final static String BUESSION_CLOUD_NAME = "X-Buession-Cloud-Version"; - protected final static List IGNORE_REQUEST_HEADERS = ListBuilder.of("Accept-Encoding"); - protected final static String REQUEST_CONTEXT_CLIENT = Feign.class.getSimpleName() + "/" + VersionUtils.determineClassVersion(Feign.class); + /** + * 允许转发的请求头 + * + * @since 2.1.0 + */ + private Set allowedHeaderNames; + + /** + * 忽略转发的请求头 + * + * @since 2.1.0 + */ + private Set ignoreHeaderNames = SetBuilder.of("Accept-Encoding"); + + protected final Logger logger = LoggerFactory.getLogger(getClass()); + + /** + * 构造函数 + */ + public AbstractClientHeadersRequestInterceptor(){ + } + + /** + * 构造函数 + * + * @param allowedHeaderNames + * 允许转发的请求头 + * @param ignoreHeaderNames + * 忽略转发的请求头 + * + * @since 2.1.0 + */ + public AbstractClientHeadersRequestInterceptor(Set allowedHeaderNames, + Set ignoreHeaderNames){ + this.allowedHeaderNames = allowedHeaderNames; + this.ignoreHeaderNames = ignoreHeaderNames; + } + + /** + * 返回允许转发的请求头 + * + * @return 允许转发的请求头 + */ + public Set getAllowedHeaderNames(){ + return allowedHeaderNames; + } + + /** + * 设置允许转发的请求头 + * + * @param allowedHeaderNames + * 允许转发的请求头 + */ + public void setAllowedHeaderNames(Set allowedHeaderNames){ + this.allowedHeaderNames = allowedHeaderNames; + } + + /** + * 返回忽略转发的请求头 + * + * @return 忽略转发的请求头 + */ + public Set getIgnoreHeaderNames(){ + return ignoreHeaderNames; + } + + /** + * 设置忽略转发的请求头 + * + * @param ignoreHeaderNames + * 忽略转发的请求头 + */ + public void setIgnoreHeaderNames(Set ignoreHeaderNames){ + this.ignoreHeaderNames = ignoreHeaderNames; + } + protected static void setRequestHeaders(final RequestTemplate requestTemplate){ requestTemplate.header(REQUEST_CONTEXT_CLIENT_NAME, REQUEST_CONTEXT_CLIENT); requestTemplate.header(BUESSION_CLOUD_NAME, Version.VERSION); } + protected boolean isIgnoreHeaderName(final String name){ + Set ignoreHeaderNames = getIgnoreHeaderNames(); + + if(Validate.isNotEmpty(ignoreHeaderNames)){ + for(String headerName : ignoreHeaderNames){ + if(headerName.contains(name)){ + if(logger.isDebugEnabled()){ + logger.debug("Ignore feign request header, name: {}", name); + } + return true; + } + } + } + + return false; + } + + protected void applyHeader(final RequestTemplate requestTemplate, final String name, final List values){ + if(isIgnoreHeaderName(name)){ + return; + } + + Set allowedHeaderNames = getAllowedHeaderNames(); + + if(Validate.isNotEmpty(allowedHeaderNames)){ + for(String headerName : allowedHeaderNames){ + if(headerName.contains(name)){ + requestTemplate.header(name, values); + if(logger.isDebugEnabled()){ + logger.debug("Add feign request header, name: {}, values: {}", name, values); + } + } + } + }else{ + requestTemplate.header(name, values); + if(logger.isDebugEnabled()){ + logger.debug("Add feign request header, name: {}, values: {}", name, values); + } + } + } + } diff --git a/buession-springcloud-feign/src/main/java/com/buession/springcloud/feign/interceptor/reactive/ReactiveClientHeadersRequestInterceptor.java b/buession-springcloud-feign/src/main/java/com/buession/springcloud/feign/interceptor/reactive/ReactiveClientHeadersRequestInterceptor.java index b3d7a8b..913cf85 100644 --- a/buession-springcloud-feign/src/main/java/com/buession/springcloud/feign/interceptor/reactive/ReactiveClientHeadersRequestInterceptor.java +++ b/buession-springcloud-feign/src/main/java/com/buession/springcloud/feign/interceptor/reactive/ReactiveClientHeadersRequestInterceptor.java @@ -25,42 +25,50 @@ package com.buession.springcloud.feign.interceptor.reactive; import com.buession.springcloud.feign.interceptor.AbstractClientHeadersRequestInterceptor; -import com.buession.web.reactive.context.request.RequestContextHolder; +import com.buession.web.reactive.context.request.ReactiveRequestAttributes; import feign.RequestTemplate; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; import org.springframework.http.server.reactive.ServerHttpRequest; -import reactor.core.publisher.Mono; +import org.springframework.web.context.request.RequestContextHolder; + +import java.util.Set; /** - * Reactive 请求头拦截器抽象类 + * Reactive 模式请求头拦截器 * * @author Yong.Teng * @since 1.2.1 */ public class ReactiveClientHeadersRequestInterceptor extends AbstractClientHeadersRequestInterceptor { - private final static Logger logger = LoggerFactory.getLogger(ReactiveClientHeadersRequestInterceptor.class); + /** + * 构造函数 + */ + public ReactiveClientHeadersRequestInterceptor(){ + super(); + } + + /** + * 构造函数 + * + * @param allowedHeaderNames + * 允许转发的请求头 + * @param ignoreHeaderNames + * 忽略转发的请求头 + * + * @since 2.1.0 + */ + public ReactiveClientHeadersRequestInterceptor(Set allowedHeaderNames, + Set ignoreHeaderNames){ + super(allowedHeaderNames, ignoreHeaderNames); + } @Override public void apply(RequestTemplate requestTemplate){ try{ - Mono mono = RequestContextHolder.getRequest(); + ReactiveRequestAttributes requestAttributes = (ReactiveRequestAttributes) RequestContextHolder.currentRequestAttributes(); + ServerHttpRequest request = requestAttributes.getRequest(); - mono.subscribe(request->{ - request.getHeaders().forEach((name, value)->{ - if(IGNORE_REQUEST_HEADERS.contains(name)){ - if(logger.isDebugEnabled()){ - logger.debug("Ignore feign request header, name: {}", name); - } - }else{ - requestTemplate.header(name, value); - if(logger.isDebugEnabled()){ - logger.debug("Add feign request header, name: {}, values: {}", name, value); - } - } - }); - }); + request.getHeaders().forEach((name, value)->applyHeader(requestTemplate, name, value)); }catch(IllegalStateException e){ logger.error(e.getMessage()); }finally{ diff --git a/buession-springcloud-feign/src/main/java/com/buession/springcloud/feign/interceptor/servlet/ServletClientHeadersRequestInterceptor.java b/buession-springcloud-feign/src/main/java/com/buession/springcloud/feign/interceptor/servlet/ServletClientHeadersRequestInterceptor.java index 404a1d4..c65071e 100644 --- a/buession-springcloud-feign/src/main/java/com/buession/springcloud/feign/interceptor/servlet/ServletClientHeadersRequestInterceptor.java +++ b/buession-springcloud-feign/src/main/java/com/buession/springcloud/feign/interceptor/servlet/ServletClientHeadersRequestInterceptor.java @@ -28,46 +28,65 @@ import com.buession.springcloud.feign.interceptor.AbstractClientHeadersRequestInterceptor; import feign.RequestTemplate; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; import org.springframework.web.context.request.RequestContextHolder; import org.springframework.web.context.request.ServletRequestAttributes; import javax.servlet.http.HttpServletRequest; +import java.util.ArrayList; import java.util.Enumeration; +import java.util.List; +import java.util.Set; /** - * Servlet 请求头拦截器抽象类 + * Servlet 模式请求头拦截器 * * @author Yong.Teng */ public class ServletClientHeadersRequestInterceptor extends AbstractClientHeadersRequestInterceptor { - private final static Logger logger = LoggerFactory.getLogger(ServletClientHeadersRequestInterceptor.class); + /** + * 构造函数 + */ + public ServletClientHeadersRequestInterceptor(){ + super(); + } + + /** + * 构造函数 + * + * @param allowedHeaderNames + * 允许转发的请求头 + * @param ignoreHeaderNames + * 忽略转发的请求头 + * + * @since 2.1.0 + */ + public ServletClientHeadersRequestInterceptor(Set allowedHeaderNames, + Set ignoreHeaderNames){ + super(allowedHeaderNames, ignoreHeaderNames); + } @Override public void apply(final RequestTemplate requestTemplate){ try{ - ServletRequestAttributes attributes = + ServletRequestAttributes requestAttributes = (ServletRequestAttributes) RequestContextHolder.currentRequestAttributes(); - HttpServletRequest request = attributes.getRequest(); + HttpServletRequest request = requestAttributes.getRequest(); Enumeration headerNames = request.getHeaderNames(); while(headerNames != null && headerNames.hasMoreElements()){ String name = headerNames.nextElement(); - if(IGNORE_REQUEST_HEADERS.contains(name)){ - if(logger.isDebugEnabled()){ - logger.debug("Ignore feign request header, name: {}", name); - } - }else{ - String value = request.getHeader(name); + if(isIgnoreHeaderName(name) == false){ + Enumeration value = request.getHeaders(name); + List values = new ArrayList<>(); - requestTemplate.header(name, value); - if(logger.isDebugEnabled()){ - logger.debug("Add feign request header, name: {}, values: {}", name, value); + while(value != null && value.hasMoreElements()){ + values.add(value.nextElement()); } + + applyHeader(requestTemplate, name, values); } } }catch(IllegalStateException e){ From 724cbaaeca406ba7496467655f9029dbf8f2a791 Mon Sep 17 00:00:00 2001 From: "Yong.Teng" Date: Mon, 8 Aug 2022 16:38:58 +0800 Subject: [PATCH 5/5] release 2.1.0 --- CHANGELOG.md | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9473482..3f7b5c1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,7 +2,7 @@ =========================== -## [2.1.0](https://github.com/buession/buession-springcloud/releases/tag/v2.1.0) (2022-07-xx) +## [2.1.0](https://github.com/buession/buession-springcloud/releases/tag/v2.1.0) (2022-08-07) ### 🔨依赖升级 @@ -13,6 +13,17 @@ ### ⭐ 新特性 - **buession-springcloud-bus:** 新增 buession-springcloud-bus module +- **buession-springcloud-feign:** 可指定允许转发和忽略的请求头 + + +### 🔔 变化 + +- **buession-springcloud-feign:** Servlet 模式请求头拦截器,ServletClientHeadersRequestInterceptor 将会转发重复请求头的所有值 + + +### 🐞 Bug 修复 + +- **buession-springcloud-feign:** 修复 ReactiveFeignInterceptorConfiguration 自动配置设置成 Type.SERVLET 的 BUG ---