From e8ee68998e44f5ad17e55aeaeada7faede27abea Mon Sep 17 00:00:00 2001 From: fangjian0423 Date: Fri, 6 Sep 2019 16:33:11 +0800 Subject: [PATCH] upgrade to Spring Cloud Hoxton, close #917 --- pom.xml | 24 +- spring-cloud-alibaba-coverage/pom.xml | 4 +- spring-cloud-alibaba-dependencies/pom.xml | 9 +- spring-cloud-alibaba-docs/pom.xml | 2 +- spring-cloud-alibaba-dubbo/pom.xml | 2 +- .../acm-example/acm-local-example/pom.xml | 2 +- .../ans-consumer-feign-example/pom.xml | 2 +- .../ans-consumer-ribbon-example/pom.xml | 2 +- .../ans-example/ans-provider-example/pom.xml | 2 +- .../nacos-config-example/pom.xml | 2 +- .../nacos-discovery-consumer-example/pom.xml | 2 +- .../nacos-discovery-provider-example/pom.xml | 2 +- .../pom.xml | 2 +- .../pom.xml | 2 +- .../nacos-discovery-example/pom.xml | 2 +- .../nacos-gateway-discovery-example/pom.xml | 2 +- .../nacos-gateway-provider-example/pom.xml | 2 +- .../nacos-gateway-example/pom.xml | 2 +- .../oss-example/pom.xml | 2 +- spring-cloud-alibaba-examples/pom.xml | 2 +- .../rocketmq-consume-example/pom.xml | 2 +- .../rocketmq-produce-example/pom.xml | 2 +- .../schedulerx-simple-task-example/pom.xml | 2 +- .../seata-example/account-service/pom.xml | 2 +- .../seata-example/business-service/pom.xml | 2 +- .../seata-example/order-service/pom.xml | 2 +- .../seata-example/storage-service/pom.xml | 2 +- .../sentinel-core-example/pom.xml | 2 +- .../sentinel-dubbo-api/pom.xml | 2 +- .../sentinel-dubbo-consumer-example/pom.xml | 2 +- .../sentinel-dubbo-provider-example/pom.xml | 2 +- .../sentinel-feign-consumer-example/pom.xml | 2 +- .../sentinel-feign-provider-example/pom.xml | 2 +- .../pom.xml | 2 +- .../sentinel-webflux-example/pom.xml | 2 +- .../sentinel-zuul-example/pom.xml | 2 +- .../sms-example/pom.xml | 2 +- .../pom.xml | 2 +- .../spring-cloud-dubbo-client-sample/pom.xml | 2 +- .../pom.xml | 2 +- .../pom.xml | 2 +- .../pom.xml | 2 +- .../spring-cloud-dubbo-sample-api/pom.xml | 2 +- .../spring-cloud-dubbo-server-sample/pom.xml | 2 +- .../pom.xml | 2 +- .../spring-cloud-bus-rocketmq-example/pom.xml | 2 +- .../pom.xml | 2 +- spring-cloud-alibaba-nacos-config/pom.xml | 2 +- spring-cloud-alibaba-nacos-discovery/pom.xml | 2 +- spring-cloud-alibaba-seata/pom.xml | 2 +- .../pom.xml | 2 +- spring-cloud-alibaba-sentinel-gateway/pom.xml | 2 +- spring-cloud-alibaba-sentinel/pom.xml | 2 +- spring-cloud-alicloud-acm/pom.xml | 2 +- spring-cloud-alicloud-ans/pom.xml | 2 +- spring-cloud-alicloud-context/pom.xml | 2 +- spring-cloud-alicloud-oss/pom.xml | 2 +- spring-cloud-alicloud-schedulerx/pom.xml | 2 +- spring-cloud-alicloud-sms/pom.xml | 2 +- spring-cloud-circuitbreaker-sentinel/pom.xml | 57 +++++ .../ReactiveSentinelCircuitBreaker.java | 104 +++++++++ ...ntinelCircuitBreakerAutoConfiguration.java | 64 ++++++ ...ReactiveSentinelCircuitBreakerFactory.java | 58 +++++ .../sentinel/SentinelCircuitBreaker.java | 114 ++++++++++ ...ntinelCircuitBreakerAutoConfiguration.java | 65 ++++++ .../SentinelCircuitBreakerFactory.java | 57 +++++ .../sentinel/SentinelConfigBuilder.java | 112 ++++++++++ .../main/resources/META-INF/spring.factories | 3 + ...SentinelCircuitBreakerIntegrationTest.java | 207 ++++++++++++++++++ .../ReactiveSentinelCircuitBreakerTest.java | 80 +++++++ ...SentinelCircuitBreakerIntegrationTest.java | 153 +++++++++++++ .../sentinel/SentinelCircuitBreakerTest.java | 86 ++++++++ spring-cloud-starter-alibaba/pom.xml | 2 +- .../pom.xml | 2 +- .../pom.xml | 2 +- .../pom.xml | 2 +- .../pom.xml | 2 +- .../pom.xml | 2 +- .../spring-cloud-starter-bus-rocketmq/pom.xml | 2 +- .../spring-cloud-starter-dubbo/pom.xml | 2 +- .../pom.xml | 2 +- spring-cloud-starter-alicloud/pom.xml | 2 +- .../spring-cloud-starter-alicloud-acm/pom.xml | 2 +- .../spring-cloud-starter-alicloud-ans/pom.xml | 2 +- .../spring-cloud-starter-alicloud-oss/pom.xml | 2 +- .../pom.xml | 2 +- .../spring-cloud-starter-alicloud-sms/pom.xml | 2 +- spring-cloud-stream-binder-rocketmq/pom.xml | 2 +- .../integration/RocketMQMessageHandler.java | 4 +- 89 files changed, 1260 insertions(+), 85 deletions(-) create mode 100644 spring-cloud-circuitbreaker-sentinel/pom.xml create mode 100644 spring-cloud-circuitbreaker-sentinel/src/main/java/com/alibaba/cloud/circuitbreaker/sentinel/ReactiveSentinelCircuitBreaker.java create mode 100644 spring-cloud-circuitbreaker-sentinel/src/main/java/com/alibaba/cloud/circuitbreaker/sentinel/ReactiveSentinelCircuitBreakerAutoConfiguration.java create mode 100644 spring-cloud-circuitbreaker-sentinel/src/main/java/com/alibaba/cloud/circuitbreaker/sentinel/ReactiveSentinelCircuitBreakerFactory.java create mode 100644 spring-cloud-circuitbreaker-sentinel/src/main/java/com/alibaba/cloud/circuitbreaker/sentinel/SentinelCircuitBreaker.java create mode 100644 spring-cloud-circuitbreaker-sentinel/src/main/java/com/alibaba/cloud/circuitbreaker/sentinel/SentinelCircuitBreakerAutoConfiguration.java create mode 100644 spring-cloud-circuitbreaker-sentinel/src/main/java/com/alibaba/cloud/circuitbreaker/sentinel/SentinelCircuitBreakerFactory.java create mode 100644 spring-cloud-circuitbreaker-sentinel/src/main/java/com/alibaba/cloud/circuitbreaker/sentinel/SentinelConfigBuilder.java create mode 100644 spring-cloud-circuitbreaker-sentinel/src/main/resources/META-INF/spring.factories create mode 100644 spring-cloud-circuitbreaker-sentinel/src/test/java/com/alibaba/cloud/circuitbreaker/sentinel/ReactiveSentinelCircuitBreakerIntegrationTest.java create mode 100644 spring-cloud-circuitbreaker-sentinel/src/test/java/com/alibaba/cloud/circuitbreaker/sentinel/ReactiveSentinelCircuitBreakerTest.java create mode 100644 spring-cloud-circuitbreaker-sentinel/src/test/java/com/alibaba/cloud/circuitbreaker/sentinel/SentinelCircuitBreakerIntegrationTest.java create mode 100644 spring-cloud-circuitbreaker-sentinel/src/test/java/com/alibaba/cloud/circuitbreaker/sentinel/SentinelCircuitBreakerTest.java diff --git a/pom.xml b/pom.xml index 7ff57e83..b305f1c1 100644 --- a/pom.xml +++ b/pom.xml @@ -8,13 +8,13 @@ org.springframework.cloud spring-cloud-build - 2.1.6.RELEASE + 2.2.0.BUILD-SNAPSHOT com.alibaba.cloud spring-cloud-alibaba - 2.1.1.BUILD-SNAPSHOT + 2.2.0.BUILD-SNAPSHOT pom Spring Cloud Alibaba Spring Cloud Alibaba @@ -71,11 +71,12 @@ - 2.1.2.RELEASE - 2.1.2.RELEASE - 2.1.2.RELEASE - 2.1.2.RELEASE - 2.1.2.RELEASE + 2.2.0.BUILD-SNAPSHOT + 2.2.0.BUILD-SNAPSHOT + 2.2.0.BUILD-SNAPSHOT + 2.2.0.BUILD-SNAPSHOT + 2.2.0.BUILD-SNAPSHOT + Horsham.BUILD-SNAPSHOT 4.12 3.0 @@ -101,6 +102,7 @@ spring-cloud-alibaba-sentinel spring-cloud-alibaba-sentinel-datasource spring-cloud-alibaba-sentinel-gateway + spring-cloud-circuitbreaker-sentinel spring-cloud-alibaba-nacos-config spring-cloud-alibaba-nacos-discovery spring-cloud-alibaba-seata @@ -187,6 +189,14 @@ import + + org.springframework.cloud + spring-cloud-stream-dependencies + ${spring-cloud-stream.version} + pom + import + + org.apache.dubbo dubbo-spring-boot-starter diff --git a/spring-cloud-alibaba-coverage/pom.xml b/spring-cloud-alibaba-coverage/pom.xml index 456dd65d..e63ab615 100644 --- a/spring-cloud-alibaba-coverage/pom.xml +++ b/spring-cloud-alibaba-coverage/pom.xml @@ -5,7 +5,7 @@ com.alibaba.cloud spring-cloud-alibaba - 2.1.1.BUILD-SNAPSHOT + 2.2.0.BUILD-SNAPSHOT 4.0.0 @@ -13,7 +13,7 @@ Spring Cloud Alibaba Coverage - 2.1.1.BUILD-SNAPSHOT + 2.2.0.BUILD-SNAPSHOT diff --git a/spring-cloud-alibaba-dependencies/pom.xml b/spring-cloud-alibaba-dependencies/pom.xml index e8530793..a15bdd26 100644 --- a/spring-cloud-alibaba-dependencies/pom.xml +++ b/spring-cloud-alibaba-dependencies/pom.xml @@ -6,13 +6,13 @@ spring-cloud-dependencies-parent org.springframework.cloud - 2.1.6.RELEASE + 2.2.0.BUILD-SNAPSHOT com.alibaba.cloud spring-cloud-alibaba-dependencies - 2.1.1.BUILD-SNAPSHOT + 2.2.0.BUILD-SNAPSHOT pom Spring Cloud Alibaba Dependencies Spring Cloud Alibaba Dependencies @@ -173,6 +173,11 @@ sentinel-apache-dubbo-adapter ${sentinel.version} + + com.alibaba.csp + sentinel-reactor-adapter + ${sentinel.version} + com.alibaba.cloud sentinel-dubbo-api diff --git a/spring-cloud-alibaba-docs/pom.xml b/spring-cloud-alibaba-docs/pom.xml index e15d9554..ede7e416 100644 --- a/spring-cloud-alibaba-docs/pom.xml +++ b/spring-cloud-alibaba-docs/pom.xml @@ -5,7 +5,7 @@ com.alibaba.cloud spring-cloud-alibaba - 2.1.1.BUILD-SNAPSHOT + 2.2.0.BUILD-SNAPSHOT 4.0.0 diff --git a/spring-cloud-alibaba-dubbo/pom.xml b/spring-cloud-alibaba-dubbo/pom.xml index 5297ee48..e03750b3 100644 --- a/spring-cloud-alibaba-dubbo/pom.xml +++ b/spring-cloud-alibaba-dubbo/pom.xml @@ -5,7 +5,7 @@ com.alibaba.cloud spring-cloud-alibaba - 2.1.1.BUILD-SNAPSHOT + 2.2.0.BUILD-SNAPSHOT ../pom.xml 4.0.0 diff --git a/spring-cloud-alibaba-examples/acm-example/acm-local-example/pom.xml b/spring-cloud-alibaba-examples/acm-example/acm-local-example/pom.xml index 5ad1812f..9111c4dd 100644 --- a/spring-cloud-alibaba-examples/acm-example/acm-local-example/pom.xml +++ b/spring-cloud-alibaba-examples/acm-example/acm-local-example/pom.xml @@ -5,7 +5,7 @@ spring-cloud-alibaba-examples com.alibaba.cloud - 2.1.1.BUILD-SNAPSHOT + 2.2.0.BUILD-SNAPSHOT ../../pom.xml 4.0.0 diff --git a/spring-cloud-alibaba-examples/ans-example/ans-consumer-feign-example/pom.xml b/spring-cloud-alibaba-examples/ans-example/ans-consumer-feign-example/pom.xml index cfccf8c5..5a631c0a 100644 --- a/spring-cloud-alibaba-examples/ans-example/ans-consumer-feign-example/pom.xml +++ b/spring-cloud-alibaba-examples/ans-example/ans-consumer-feign-example/pom.xml @@ -5,7 +5,7 @@ spring-cloud-alibaba-examples com.alibaba.cloud - 2.1.1.BUILD-SNAPSHOT + 2.2.0.BUILD-SNAPSHOT ../../pom.xml 4.0.0 diff --git a/spring-cloud-alibaba-examples/ans-example/ans-consumer-ribbon-example/pom.xml b/spring-cloud-alibaba-examples/ans-example/ans-consumer-ribbon-example/pom.xml index e1bc8438..a53d0b51 100644 --- a/spring-cloud-alibaba-examples/ans-example/ans-consumer-ribbon-example/pom.xml +++ b/spring-cloud-alibaba-examples/ans-example/ans-consumer-ribbon-example/pom.xml @@ -5,7 +5,7 @@ spring-cloud-alibaba-examples com.alibaba.cloud - 2.1.1.BUILD-SNAPSHOT + 2.2.0.BUILD-SNAPSHOT ../../pom.xml 4.0.0 diff --git a/spring-cloud-alibaba-examples/ans-example/ans-provider-example/pom.xml b/spring-cloud-alibaba-examples/ans-example/ans-provider-example/pom.xml index c2d3265a..f3acbaa7 100644 --- a/spring-cloud-alibaba-examples/ans-example/ans-provider-example/pom.xml +++ b/spring-cloud-alibaba-examples/ans-example/ans-provider-example/pom.xml @@ -5,7 +5,7 @@ spring-cloud-alibaba-examples com.alibaba.cloud - 2.1.1.BUILD-SNAPSHOT + 2.2.0.BUILD-SNAPSHOT ../../pom.xml 4.0.0 diff --git a/spring-cloud-alibaba-examples/nacos-example/nacos-config-example/pom.xml b/spring-cloud-alibaba-examples/nacos-example/nacos-config-example/pom.xml index ab411e5f..80853890 100644 --- a/spring-cloud-alibaba-examples/nacos-example/nacos-config-example/pom.xml +++ b/spring-cloud-alibaba-examples/nacos-example/nacos-config-example/pom.xml @@ -5,7 +5,7 @@ com.alibaba.cloud spring-cloud-alibaba-examples - 2.1.1.BUILD-SNAPSHOT + 2.2.0.BUILD-SNAPSHOT ../../pom.xml 4.0.0 diff --git a/spring-cloud-alibaba-examples/nacos-example/nacos-discovery-example/nacos-discovery-consumer-example/pom.xml b/spring-cloud-alibaba-examples/nacos-example/nacos-discovery-example/nacos-discovery-consumer-example/pom.xml index afa3904b..4fee805a 100644 --- a/spring-cloud-alibaba-examples/nacos-example/nacos-discovery-example/nacos-discovery-consumer-example/pom.xml +++ b/spring-cloud-alibaba-examples/nacos-example/nacos-discovery-example/nacos-discovery-consumer-example/pom.xml @@ -5,7 +5,7 @@ com.alibaba.cloud nacos-discovery-example - 2.1.1.BUILD-SNAPSHOT + 2.2.0.BUILD-SNAPSHOT 4.0.0 diff --git a/spring-cloud-alibaba-examples/nacos-example/nacos-discovery-example/nacos-discovery-provider-example/pom.xml b/spring-cloud-alibaba-examples/nacos-example/nacos-discovery-example/nacos-discovery-provider-example/pom.xml index ca15c8ba..a4e120ac 100644 --- a/spring-cloud-alibaba-examples/nacos-example/nacos-discovery-example/nacos-discovery-provider-example/pom.xml +++ b/spring-cloud-alibaba-examples/nacos-example/nacos-discovery-example/nacos-discovery-provider-example/pom.xml @@ -5,7 +5,7 @@ com.alibaba.cloud nacos-discovery-example - 2.1.1.BUILD-SNAPSHOT + 2.2.0.BUILD-SNAPSHOT 4.0.0 diff --git a/spring-cloud-alibaba-examples/nacos-example/nacos-discovery-example/nacos-discovery-spring-cloud-config-client/pom.xml b/spring-cloud-alibaba-examples/nacos-example/nacos-discovery-example/nacos-discovery-spring-cloud-config-client/pom.xml index 116b91e9..afd78580 100644 --- a/spring-cloud-alibaba-examples/nacos-example/nacos-discovery-example/nacos-discovery-spring-cloud-config-client/pom.xml +++ b/spring-cloud-alibaba-examples/nacos-example/nacos-discovery-example/nacos-discovery-spring-cloud-config-client/pom.xml @@ -5,7 +5,7 @@ com.alibaba.cloud nacos-discovery-example - 2.1.1.BUILD-SNAPSHOT + 2.2.0.BUILD-SNAPSHOT 4.0.0 diff --git a/spring-cloud-alibaba-examples/nacos-example/nacos-discovery-example/nacos-discovery-spring-cloud-config-server/pom.xml b/spring-cloud-alibaba-examples/nacos-example/nacos-discovery-example/nacos-discovery-spring-cloud-config-server/pom.xml index b09a7a17..0ef1d6fd 100644 --- a/spring-cloud-alibaba-examples/nacos-example/nacos-discovery-example/nacos-discovery-spring-cloud-config-server/pom.xml +++ b/spring-cloud-alibaba-examples/nacos-example/nacos-discovery-example/nacos-discovery-spring-cloud-config-server/pom.xml @@ -5,7 +5,7 @@ com.alibaba.cloud nacos-discovery-example - 2.1.1.BUILD-SNAPSHOT + 2.2.0.BUILD-SNAPSHOT 4.0.0 diff --git a/spring-cloud-alibaba-examples/nacos-example/nacos-discovery-example/pom.xml b/spring-cloud-alibaba-examples/nacos-example/nacos-discovery-example/pom.xml index 0b996ec3..bcf7b830 100644 --- a/spring-cloud-alibaba-examples/nacos-example/nacos-discovery-example/pom.xml +++ b/spring-cloud-alibaba-examples/nacos-example/nacos-discovery-example/pom.xml @@ -5,7 +5,7 @@ com.alibaba.cloud spring-cloud-alibaba-examples - 2.1.1.BUILD-SNAPSHOT + 2.2.0.BUILD-SNAPSHOT ../../pom.xml 4.0.0 diff --git a/spring-cloud-alibaba-examples/nacos-example/nacos-gateway-example/nacos-gateway-discovery-example/pom.xml b/spring-cloud-alibaba-examples/nacos-example/nacos-gateway-example/nacos-gateway-discovery-example/pom.xml index a1c35a7d..92af4fbb 100644 --- a/spring-cloud-alibaba-examples/nacos-example/nacos-gateway-example/nacos-gateway-discovery-example/pom.xml +++ b/spring-cloud-alibaba-examples/nacos-example/nacos-gateway-example/nacos-gateway-discovery-example/pom.xml @@ -5,7 +5,7 @@ com.alibaba.cloud nacos-gateway-example - 2.1.1.BUILD-SNAPSHOT + 2.2.0.BUILD-SNAPSHOT 4.0.0 diff --git a/spring-cloud-alibaba-examples/nacos-example/nacos-gateway-example/nacos-gateway-provider-example/pom.xml b/spring-cloud-alibaba-examples/nacos-example/nacos-gateway-example/nacos-gateway-provider-example/pom.xml index 8a0969af..6c722850 100644 --- a/spring-cloud-alibaba-examples/nacos-example/nacos-gateway-example/nacos-gateway-provider-example/pom.xml +++ b/spring-cloud-alibaba-examples/nacos-example/nacos-gateway-example/nacos-gateway-provider-example/pom.xml @@ -5,7 +5,7 @@ com.alibaba.cloud nacos-gateway-example - 2.1.1.BUILD-SNAPSHOT + 2.2.0.BUILD-SNAPSHOT 4.0.0 diff --git a/spring-cloud-alibaba-examples/nacos-example/nacos-gateway-example/pom.xml b/spring-cloud-alibaba-examples/nacos-example/nacos-gateway-example/pom.xml index a0c2e94e..6152c574 100644 --- a/spring-cloud-alibaba-examples/nacos-example/nacos-gateway-example/pom.xml +++ b/spring-cloud-alibaba-examples/nacos-example/nacos-gateway-example/pom.xml @@ -5,7 +5,7 @@ com.alibaba.cloud spring-cloud-alibaba-examples - 2.1.1.BUILD-SNAPSHOT + 2.2.0.BUILD-SNAPSHOT ../../pom.xml 4.0.0 diff --git a/spring-cloud-alibaba-examples/oss-example/pom.xml b/spring-cloud-alibaba-examples/oss-example/pom.xml index c0fab28c..e4785862 100644 --- a/spring-cloud-alibaba-examples/oss-example/pom.xml +++ b/spring-cloud-alibaba-examples/oss-example/pom.xml @@ -5,7 +5,7 @@ com.alibaba.cloud spring-cloud-alibaba-examples - 2.1.1.BUILD-SNAPSHOT + 2.2.0.BUILD-SNAPSHOT 4.0.0 diff --git a/spring-cloud-alibaba-examples/pom.xml b/spring-cloud-alibaba-examples/pom.xml index bb19d74e..6f30e338 100644 --- a/spring-cloud-alibaba-examples/pom.xml +++ b/spring-cloud-alibaba-examples/pom.xml @@ -5,7 +5,7 @@ com.alibaba.cloud spring-cloud-alibaba - 2.1.1.BUILD-SNAPSHOT + 2.2.0.BUILD-SNAPSHOT ../pom.xml 4.0.0 diff --git a/spring-cloud-alibaba-examples/rocketmq-example/rocketmq-consume-example/pom.xml b/spring-cloud-alibaba-examples/rocketmq-example/rocketmq-consume-example/pom.xml index 495b3c48..1a3d3646 100644 --- a/spring-cloud-alibaba-examples/rocketmq-example/rocketmq-consume-example/pom.xml +++ b/spring-cloud-alibaba-examples/rocketmq-example/rocketmq-consume-example/pom.xml @@ -5,7 +5,7 @@ com.alibaba.cloud spring-cloud-alibaba-examples - 2.1.1.BUILD-SNAPSHOT + 2.2.0.BUILD-SNAPSHOT ../../pom.xml 4.0.0 diff --git a/spring-cloud-alibaba-examples/rocketmq-example/rocketmq-produce-example/pom.xml b/spring-cloud-alibaba-examples/rocketmq-example/rocketmq-produce-example/pom.xml index 1222a865..663ff8ee 100644 --- a/spring-cloud-alibaba-examples/rocketmq-example/rocketmq-produce-example/pom.xml +++ b/spring-cloud-alibaba-examples/rocketmq-example/rocketmq-produce-example/pom.xml @@ -5,7 +5,7 @@ com.alibaba.cloud spring-cloud-alibaba-examples - 2.1.1.BUILD-SNAPSHOT + 2.2.0.BUILD-SNAPSHOT ../../pom.xml 4.0.0 diff --git a/spring-cloud-alibaba-examples/schedulerx-example/schedulerx-simple-task-example/pom.xml b/spring-cloud-alibaba-examples/schedulerx-example/schedulerx-simple-task-example/pom.xml index 8c2e6b5e..3467be0c 100644 --- a/spring-cloud-alibaba-examples/schedulerx-example/schedulerx-simple-task-example/pom.xml +++ b/spring-cloud-alibaba-examples/schedulerx-example/schedulerx-simple-task-example/pom.xml @@ -5,7 +5,7 @@ spring-cloud-alibaba-examples com.alibaba.cloud - 2.1.1.BUILD-SNAPSHOT + 2.2.0.BUILD-SNAPSHOT ../../pom.xml 4.0.0 diff --git a/spring-cloud-alibaba-examples/seata-example/account-service/pom.xml b/spring-cloud-alibaba-examples/seata-example/account-service/pom.xml index a85ebef2..428fcebc 100644 --- a/spring-cloud-alibaba-examples/seata-example/account-service/pom.xml +++ b/spring-cloud-alibaba-examples/seata-example/account-service/pom.xml @@ -5,7 +5,7 @@ spring-cloud-alibaba-examples com.alibaba.cloud - 2.1.1.BUILD-SNAPSHOT + 2.2.0.BUILD-SNAPSHOT ../../pom.xml 4.0.0 diff --git a/spring-cloud-alibaba-examples/seata-example/business-service/pom.xml b/spring-cloud-alibaba-examples/seata-example/business-service/pom.xml index 4cffabf1..bd58fe41 100644 --- a/spring-cloud-alibaba-examples/seata-example/business-service/pom.xml +++ b/spring-cloud-alibaba-examples/seata-example/business-service/pom.xml @@ -5,7 +5,7 @@ spring-cloud-alibaba-examples com.alibaba.cloud - 2.1.1.BUILD-SNAPSHOT + 2.2.0.BUILD-SNAPSHOT ../../pom.xml 4.0.0 diff --git a/spring-cloud-alibaba-examples/seata-example/order-service/pom.xml b/spring-cloud-alibaba-examples/seata-example/order-service/pom.xml index a257acc8..0749a727 100644 --- a/spring-cloud-alibaba-examples/seata-example/order-service/pom.xml +++ b/spring-cloud-alibaba-examples/seata-example/order-service/pom.xml @@ -5,7 +5,7 @@ spring-cloud-alibaba-examples com.alibaba.cloud - 2.1.1.BUILD-SNAPSHOT + 2.2.0.BUILD-SNAPSHOT ../../pom.xml 4.0.0 diff --git a/spring-cloud-alibaba-examples/seata-example/storage-service/pom.xml b/spring-cloud-alibaba-examples/seata-example/storage-service/pom.xml index 9c6b2c34..a2c8f3ee 100644 --- a/spring-cloud-alibaba-examples/seata-example/storage-service/pom.xml +++ b/spring-cloud-alibaba-examples/seata-example/storage-service/pom.xml @@ -5,7 +5,7 @@ spring-cloud-alibaba-examples com.alibaba.cloud - 2.1.1.BUILD-SNAPSHOT + 2.2.0.BUILD-SNAPSHOT ../../pom.xml 4.0.0 diff --git a/spring-cloud-alibaba-examples/sentinel-example/sentinel-core-example/pom.xml b/spring-cloud-alibaba-examples/sentinel-example/sentinel-core-example/pom.xml index 960b34ec..3b7c0ce6 100644 --- a/spring-cloud-alibaba-examples/sentinel-example/sentinel-core-example/pom.xml +++ b/spring-cloud-alibaba-examples/sentinel-example/sentinel-core-example/pom.xml @@ -5,7 +5,7 @@ com.alibaba.cloud spring-cloud-alibaba-examples - 2.1.1.BUILD-SNAPSHOT + 2.2.0.BUILD-SNAPSHOT ../../pom.xml 4.0.0 diff --git a/spring-cloud-alibaba-examples/sentinel-example/sentinel-dubbo-example/sentinel-dubbo-api/pom.xml b/spring-cloud-alibaba-examples/sentinel-example/sentinel-dubbo-example/sentinel-dubbo-api/pom.xml index 7daa7a75..3eeabc47 100644 --- a/spring-cloud-alibaba-examples/sentinel-example/sentinel-dubbo-example/sentinel-dubbo-api/pom.xml +++ b/spring-cloud-alibaba-examples/sentinel-example/sentinel-dubbo-example/sentinel-dubbo-api/pom.xml @@ -5,7 +5,7 @@ com.alibaba.cloud spring-cloud-alibaba-examples - 2.1.1.BUILD-SNAPSHOT + 2.2.0.BUILD-SNAPSHOT ../../../pom.xml 4.0.0 diff --git a/spring-cloud-alibaba-examples/sentinel-example/sentinel-dubbo-example/sentinel-dubbo-consumer-example/pom.xml b/spring-cloud-alibaba-examples/sentinel-example/sentinel-dubbo-example/sentinel-dubbo-consumer-example/pom.xml index f0b9a131..31bc8030 100644 --- a/spring-cloud-alibaba-examples/sentinel-example/sentinel-dubbo-example/sentinel-dubbo-consumer-example/pom.xml +++ b/spring-cloud-alibaba-examples/sentinel-example/sentinel-dubbo-example/sentinel-dubbo-consumer-example/pom.xml @@ -5,7 +5,7 @@ com.alibaba.cloud spring-cloud-alibaba-examples - 2.1.1.BUILD-SNAPSHOT + 2.2.0.BUILD-SNAPSHOT ../../../pom.xml 4.0.0 diff --git a/spring-cloud-alibaba-examples/sentinel-example/sentinel-dubbo-example/sentinel-dubbo-provider-example/pom.xml b/spring-cloud-alibaba-examples/sentinel-example/sentinel-dubbo-example/sentinel-dubbo-provider-example/pom.xml index cd888ac8..af1bbac8 100644 --- a/spring-cloud-alibaba-examples/sentinel-example/sentinel-dubbo-example/sentinel-dubbo-provider-example/pom.xml +++ b/spring-cloud-alibaba-examples/sentinel-example/sentinel-dubbo-example/sentinel-dubbo-provider-example/pom.xml @@ -5,7 +5,7 @@ com.alibaba.cloud spring-cloud-alibaba-examples - 2.1.1.BUILD-SNAPSHOT + 2.2.0.BUILD-SNAPSHOT ../../../pom.xml 4.0.0 diff --git a/spring-cloud-alibaba-examples/sentinel-example/sentinel-feign-example/sentinel-feign-consumer-example/pom.xml b/spring-cloud-alibaba-examples/sentinel-example/sentinel-feign-example/sentinel-feign-consumer-example/pom.xml index 4a706808..095bb5ef 100644 --- a/spring-cloud-alibaba-examples/sentinel-example/sentinel-feign-example/sentinel-feign-consumer-example/pom.xml +++ b/spring-cloud-alibaba-examples/sentinel-example/sentinel-feign-example/sentinel-feign-consumer-example/pom.xml @@ -5,7 +5,7 @@ com.alibaba.cloud spring-cloud-alibaba-examples - 2.1.1.BUILD-SNAPSHOT + 2.2.0.BUILD-SNAPSHOT ../../../pom.xml 4.0.0 diff --git a/spring-cloud-alibaba-examples/sentinel-example/sentinel-feign-example/sentinel-feign-provider-example/pom.xml b/spring-cloud-alibaba-examples/sentinel-example/sentinel-feign-example/sentinel-feign-provider-example/pom.xml index e57dd23f..00987133 100644 --- a/spring-cloud-alibaba-examples/sentinel-example/sentinel-feign-example/sentinel-feign-provider-example/pom.xml +++ b/spring-cloud-alibaba-examples/sentinel-example/sentinel-feign-example/sentinel-feign-provider-example/pom.xml @@ -5,7 +5,7 @@ com.alibaba.cloud spring-cloud-alibaba-examples - 2.1.1.BUILD-SNAPSHOT + 2.2.0.BUILD-SNAPSHOT ../../../pom.xml 4.0.0 diff --git a/spring-cloud-alibaba-examples/sentinel-example/sentinel-spring-cloud-gateway-example/pom.xml b/spring-cloud-alibaba-examples/sentinel-example/sentinel-spring-cloud-gateway-example/pom.xml index 2cf43f39..d5affb7f 100644 --- a/spring-cloud-alibaba-examples/sentinel-example/sentinel-spring-cloud-gateway-example/pom.xml +++ b/spring-cloud-alibaba-examples/sentinel-example/sentinel-spring-cloud-gateway-example/pom.xml @@ -5,7 +5,7 @@ com.alibaba.cloud spring-cloud-alibaba-examples - 2.1.1.BUILD-SNAPSHOT + 2.2.0.BUILD-SNAPSHOT ../../pom.xml 4.0.0 diff --git a/spring-cloud-alibaba-examples/sentinel-example/sentinel-webflux-example/pom.xml b/spring-cloud-alibaba-examples/sentinel-example/sentinel-webflux-example/pom.xml index 482c5907..26750333 100644 --- a/spring-cloud-alibaba-examples/sentinel-example/sentinel-webflux-example/pom.xml +++ b/spring-cloud-alibaba-examples/sentinel-example/sentinel-webflux-example/pom.xml @@ -5,7 +5,7 @@ com.alibaba.cloud spring-cloud-alibaba-examples - 2.1.1.BUILD-SNAPSHOT + 2.2.0.BUILD-SNAPSHOT ../../pom.xml 4.0.0 diff --git a/spring-cloud-alibaba-examples/sentinel-example/sentinel-zuul-example/pom.xml b/spring-cloud-alibaba-examples/sentinel-example/sentinel-zuul-example/pom.xml index eaedfdc7..64412863 100644 --- a/spring-cloud-alibaba-examples/sentinel-example/sentinel-zuul-example/pom.xml +++ b/spring-cloud-alibaba-examples/sentinel-example/sentinel-zuul-example/pom.xml @@ -5,7 +5,7 @@ com.alibaba.cloud spring-cloud-alibaba-examples - 2.1.1.BUILD-SNAPSHOT + 2.2.0.BUILD-SNAPSHOT ../../pom.xml 4.0.0 diff --git a/spring-cloud-alibaba-examples/sms-example/pom.xml b/spring-cloud-alibaba-examples/sms-example/pom.xml index b5379981..781ec373 100644 --- a/spring-cloud-alibaba-examples/sms-example/pom.xml +++ b/spring-cloud-alibaba-examples/sms-example/pom.xml @@ -10,7 +10,7 @@ spring-cloud-alibaba-examples com.alibaba.cloud - 2.1.1.BUILD-SNAPSHOT + 2.2.0.BUILD-SNAPSHOT ../pom.xml diff --git a/spring-cloud-alibaba-examples/spring-cloud-alibaba-dubbo-examples/pom.xml b/spring-cloud-alibaba-examples/spring-cloud-alibaba-dubbo-examples/pom.xml index 89621923..5e1c6b70 100644 --- a/spring-cloud-alibaba-examples/spring-cloud-alibaba-dubbo-examples/pom.xml +++ b/spring-cloud-alibaba-examples/spring-cloud-alibaba-dubbo-examples/pom.xml @@ -12,7 +12,7 @@ com.alibaba.cloud spring-cloud-alibaba-dubbo-examples - 2.1.1.BUILD-SNAPSHOT + 2.2.0.BUILD-SNAPSHOT Spring Cloud Alibaba Dubbo Examples pom diff --git a/spring-cloud-alibaba-examples/spring-cloud-alibaba-dubbo-examples/spring-cloud-dubbo-client-sample/pom.xml b/spring-cloud-alibaba-examples/spring-cloud-alibaba-dubbo-examples/spring-cloud-dubbo-client-sample/pom.xml index 9e5ab0fb..1d0ceec0 100644 --- a/spring-cloud-alibaba-examples/spring-cloud-alibaba-dubbo-examples/spring-cloud-dubbo-client-sample/pom.xml +++ b/spring-cloud-alibaba-examples/spring-cloud-alibaba-dubbo-examples/spring-cloud-dubbo-client-sample/pom.xml @@ -13,7 +13,7 @@ com.alibaba.cloud spring-cloud-dubbo-client-sample Spring Cloud Dubbo Client Sample - 2.1.1.BUILD-SNAPSHOT + 2.2.0.BUILD-SNAPSHOT diff --git a/spring-cloud-alibaba-examples/spring-cloud-alibaba-dubbo-examples/spring-cloud-dubbo-consumer-sample/pom.xml b/spring-cloud-alibaba-examples/spring-cloud-alibaba-dubbo-examples/spring-cloud-dubbo-consumer-sample/pom.xml index 15bef9e8..0b6e087c 100644 --- a/spring-cloud-alibaba-examples/spring-cloud-alibaba-dubbo-examples/spring-cloud-dubbo-consumer-sample/pom.xml +++ b/spring-cloud-alibaba-examples/spring-cloud-alibaba-dubbo-examples/spring-cloud-dubbo-consumer-sample/pom.xml @@ -5,7 +5,7 @@ com.alibaba.cloud spring-cloud-alibaba-dubbo-examples - 2.1.1.BUILD-SNAPSHOT + 2.2.0.BUILD-SNAPSHOT ../pom.xml 4.0.0 diff --git a/spring-cloud-alibaba-examples/spring-cloud-alibaba-dubbo-examples/spring-cloud-dubbo-provider-sample/pom.xml b/spring-cloud-alibaba-examples/spring-cloud-alibaba-dubbo-examples/spring-cloud-dubbo-provider-sample/pom.xml index b876fe4c..3cd0be99 100644 --- a/spring-cloud-alibaba-examples/spring-cloud-alibaba-dubbo-examples/spring-cloud-dubbo-provider-sample/pom.xml +++ b/spring-cloud-alibaba-examples/spring-cloud-alibaba-dubbo-examples/spring-cloud-dubbo-provider-sample/pom.xml @@ -5,7 +5,7 @@ com.alibaba.cloud spring-cloud-alibaba-dubbo-examples - 2.1.1.BUILD-SNAPSHOT + 2.2.0.BUILD-SNAPSHOT ../pom.xml 4.0.0 diff --git a/spring-cloud-alibaba-examples/spring-cloud-alibaba-dubbo-examples/spring-cloud-dubbo-provider-web-sample/pom.xml b/spring-cloud-alibaba-examples/spring-cloud-alibaba-dubbo-examples/spring-cloud-dubbo-provider-web-sample/pom.xml index c6d7d7d5..b7f17bb6 100644 --- a/spring-cloud-alibaba-examples/spring-cloud-alibaba-dubbo-examples/spring-cloud-dubbo-provider-web-sample/pom.xml +++ b/spring-cloud-alibaba-examples/spring-cloud-alibaba-dubbo-examples/spring-cloud-dubbo-provider-web-sample/pom.xml @@ -5,7 +5,7 @@ com.alibaba.cloud spring-cloud-alibaba-dubbo-examples - 2.1.1.BUILD-SNAPSHOT + 2.2.0.BUILD-SNAPSHOT ../pom.xml 4.0.0 diff --git a/spring-cloud-alibaba-examples/spring-cloud-alibaba-dubbo-examples/spring-cloud-dubbo-sample-api/pom.xml b/spring-cloud-alibaba-examples/spring-cloud-alibaba-dubbo-examples/spring-cloud-dubbo-sample-api/pom.xml index 989aac8e..0ae78ede 100644 --- a/spring-cloud-alibaba-examples/spring-cloud-alibaba-dubbo-examples/spring-cloud-dubbo-sample-api/pom.xml +++ b/spring-cloud-alibaba-examples/spring-cloud-alibaba-dubbo-examples/spring-cloud-dubbo-sample-api/pom.xml @@ -5,7 +5,7 @@ com.alibaba.cloud spring-cloud-alibaba-dubbo-examples - 2.1.1.BUILD-SNAPSHOT + 2.2.0.BUILD-SNAPSHOT 4.0.0 diff --git a/spring-cloud-alibaba-examples/spring-cloud-alibaba-dubbo-examples/spring-cloud-dubbo-server-sample/pom.xml b/spring-cloud-alibaba-examples/spring-cloud-alibaba-dubbo-examples/spring-cloud-dubbo-server-sample/pom.xml index 9e1103ad..8ff77ac1 100644 --- a/spring-cloud-alibaba-examples/spring-cloud-alibaba-dubbo-examples/spring-cloud-dubbo-server-sample/pom.xml +++ b/spring-cloud-alibaba-examples/spring-cloud-alibaba-dubbo-examples/spring-cloud-dubbo-server-sample/pom.xml @@ -14,7 +14,7 @@ com.alibaba.cloud spring-cloud-dubbo-server-sample Spring Cloud Dubbo Server Sample - 2.1.1.BUILD-SNAPSHOT + 2.2.0.BUILD-SNAPSHOT diff --git a/spring-cloud-alibaba-examples/spring-cloud-alibaba-dubbo-examples/spring-cloud-dubbo-servlet-gateway-sample/pom.xml b/spring-cloud-alibaba-examples/spring-cloud-alibaba-dubbo-examples/spring-cloud-dubbo-servlet-gateway-sample/pom.xml index 3a6803a4..b085481a 100644 --- a/spring-cloud-alibaba-examples/spring-cloud-alibaba-dubbo-examples/spring-cloud-dubbo-servlet-gateway-sample/pom.xml +++ b/spring-cloud-alibaba-examples/spring-cloud-alibaba-dubbo-examples/spring-cloud-dubbo-servlet-gateway-sample/pom.xml @@ -5,7 +5,7 @@ com.alibaba.cloud spring-cloud-alibaba-dubbo-examples - 2.1.1.BUILD-SNAPSHOT + 2.2.0.BUILD-SNAPSHOT ../pom.xml 4.0.0 diff --git a/spring-cloud-alibaba-examples/spring-cloud-bus-rocketmq-example/pom.xml b/spring-cloud-alibaba-examples/spring-cloud-bus-rocketmq-example/pom.xml index 4d78df66..96e60a53 100644 --- a/spring-cloud-alibaba-examples/spring-cloud-bus-rocketmq-example/pom.xml +++ b/spring-cloud-alibaba-examples/spring-cloud-bus-rocketmq-example/pom.xml @@ -5,7 +5,7 @@ spring-cloud-alibaba-examples com.alibaba.cloud - 2.1.1.BUILD-SNAPSHOT + 2.2.0.BUILD-SNAPSHOT ../pom.xml 4.0.0 diff --git a/spring-cloud-alibaba-nacos-config-server/pom.xml b/spring-cloud-alibaba-nacos-config-server/pom.xml index e604fba6..2823696f 100644 --- a/spring-cloud-alibaba-nacos-config-server/pom.xml +++ b/spring-cloud-alibaba-nacos-config-server/pom.xml @@ -5,7 +5,7 @@ com.alibaba.cloud spring-cloud-alibaba - 2.1.1.BUILD-SNAPSHOT + 2.2.0.BUILD-SNAPSHOT ../pom.xml 4.0.0 diff --git a/spring-cloud-alibaba-nacos-config/pom.xml b/spring-cloud-alibaba-nacos-config/pom.xml index d40aeaf2..cf06182e 100644 --- a/spring-cloud-alibaba-nacos-config/pom.xml +++ b/spring-cloud-alibaba-nacos-config/pom.xml @@ -5,7 +5,7 @@ com.alibaba.cloud spring-cloud-alibaba - 2.1.1.BUILD-SNAPSHOT + 2.2.0.BUILD-SNAPSHOT 4.0.0 diff --git a/spring-cloud-alibaba-nacos-discovery/pom.xml b/spring-cloud-alibaba-nacos-discovery/pom.xml index db9fed76..f061ce22 100644 --- a/spring-cloud-alibaba-nacos-discovery/pom.xml +++ b/spring-cloud-alibaba-nacos-discovery/pom.xml @@ -5,7 +5,7 @@ com.alibaba.cloud spring-cloud-alibaba - 2.1.1.BUILD-SNAPSHOT + 2.2.0.BUILD-SNAPSHOT 4.0.0 diff --git a/spring-cloud-alibaba-seata/pom.xml b/spring-cloud-alibaba-seata/pom.xml index c283204a..5f4a2802 100644 --- a/spring-cloud-alibaba-seata/pom.xml +++ b/spring-cloud-alibaba-seata/pom.xml @@ -5,7 +5,7 @@ com.alibaba.cloud spring-cloud-alibaba - 2.1.1.BUILD-SNAPSHOT + 2.2.0.BUILD-SNAPSHOT 4.0.0 diff --git a/spring-cloud-alibaba-sentinel-datasource/pom.xml b/spring-cloud-alibaba-sentinel-datasource/pom.xml index 6df8f7b8..1b60e41d 100644 --- a/spring-cloud-alibaba-sentinel-datasource/pom.xml +++ b/spring-cloud-alibaba-sentinel-datasource/pom.xml @@ -5,7 +5,7 @@ com.alibaba.cloud spring-cloud-alibaba - 2.1.1.BUILD-SNAPSHOT + 2.2.0.BUILD-SNAPSHOT 4.0.0 diff --git a/spring-cloud-alibaba-sentinel-gateway/pom.xml b/spring-cloud-alibaba-sentinel-gateway/pom.xml index 8312f2f8..dedd7e7a 100644 --- a/spring-cloud-alibaba-sentinel-gateway/pom.xml +++ b/spring-cloud-alibaba-sentinel-gateway/pom.xml @@ -5,7 +5,7 @@ com.alibaba.cloud spring-cloud-alibaba - 2.1.1.BUILD-SNAPSHOT + 2.2.0.BUILD-SNAPSHOT 4.0.0 diff --git a/spring-cloud-alibaba-sentinel/pom.xml b/spring-cloud-alibaba-sentinel/pom.xml index 352cf953..b2ec4afc 100644 --- a/spring-cloud-alibaba-sentinel/pom.xml +++ b/spring-cloud-alibaba-sentinel/pom.xml @@ -5,7 +5,7 @@ com.alibaba.cloud spring-cloud-alibaba - 2.1.1.BUILD-SNAPSHOT + 2.2.0.BUILD-SNAPSHOT 4.0.0 diff --git a/spring-cloud-alicloud-acm/pom.xml b/spring-cloud-alicloud-acm/pom.xml index f771a74a..58c4ddf0 100644 --- a/spring-cloud-alicloud-acm/pom.xml +++ b/spring-cloud-alicloud-acm/pom.xml @@ -6,7 +6,7 @@ com.alibaba.cloud spring-cloud-alibaba - 2.1.1.BUILD-SNAPSHOT + 2.2.0.BUILD-SNAPSHOT spring-cloud-alicloud-acm diff --git a/spring-cloud-alicloud-ans/pom.xml b/spring-cloud-alicloud-ans/pom.xml index 16876a22..e7962dea 100644 --- a/spring-cloud-alicloud-ans/pom.xml +++ b/spring-cloud-alicloud-ans/pom.xml @@ -5,7 +5,7 @@ com.alibaba.cloud spring-cloud-alibaba - 2.1.1.BUILD-SNAPSHOT + 2.2.0.BUILD-SNAPSHOT 4.0.0 diff --git a/spring-cloud-alicloud-context/pom.xml b/spring-cloud-alicloud-context/pom.xml index 6aff6346..71f281b3 100644 --- a/spring-cloud-alicloud-context/pom.xml +++ b/spring-cloud-alicloud-context/pom.xml @@ -5,7 +5,7 @@ com.alibaba.cloud spring-cloud-alibaba - 2.1.1.BUILD-SNAPSHOT + 2.2.0.BUILD-SNAPSHOT 4.0.0 diff --git a/spring-cloud-alicloud-oss/pom.xml b/spring-cloud-alicloud-oss/pom.xml index 85318849..12dfb67c 100644 --- a/spring-cloud-alicloud-oss/pom.xml +++ b/spring-cloud-alicloud-oss/pom.xml @@ -5,7 +5,7 @@ com.alibaba.cloud spring-cloud-alibaba - 2.1.1.BUILD-SNAPSHOT + 2.2.0.BUILD-SNAPSHOT 4.0.0 diff --git a/spring-cloud-alicloud-schedulerx/pom.xml b/spring-cloud-alicloud-schedulerx/pom.xml index dac0e7c5..29039126 100644 --- a/spring-cloud-alicloud-schedulerx/pom.xml +++ b/spring-cloud-alicloud-schedulerx/pom.xml @@ -5,7 +5,7 @@ com.alibaba.cloud spring-cloud-alibaba - 2.1.1.BUILD-SNAPSHOT + 2.2.0.BUILD-SNAPSHOT 4.0.0 spring-cloud-alicloud-schedulerx diff --git a/spring-cloud-alicloud-sms/pom.xml b/spring-cloud-alicloud-sms/pom.xml index de32ec3b..8d63957f 100644 --- a/spring-cloud-alicloud-sms/pom.xml +++ b/spring-cloud-alicloud-sms/pom.xml @@ -5,7 +5,7 @@ com.alibaba.cloud spring-cloud-alibaba - 2.1.1.BUILD-SNAPSHOT + 2.2.0.BUILD-SNAPSHOT 4.0.0 diff --git a/spring-cloud-circuitbreaker-sentinel/pom.xml b/spring-cloud-circuitbreaker-sentinel/pom.xml new file mode 100644 index 00000000..2896706d --- /dev/null +++ b/spring-cloud-circuitbreaker-sentinel/pom.xml @@ -0,0 +1,57 @@ + + + + + com.alibaba.cloud + spring-cloud-alibaba + 2.2.0.BUILD-SNAPSHOT + + 4.0.0 + + spring-cloud-circuitbreaker-sentinel + Spring Cloud Circuit Breaker Sentinel + + + + + org.springframework.cloud + spring-cloud-commons + + + com.alibaba.csp + sentinel-core + + + com.alibaba.csp + sentinel-reactor-adapter + + + org.springframework.boot + spring-boot-starter-web + true + + + io.projectreactor + reactor-core + true + + + org.springframework.boot + spring-boot-starter-webflux + test + + + org.springframework.boot + spring-boot-starter-test + test + + + io.projectreactor + reactor-test + test + + + + + diff --git a/spring-cloud-circuitbreaker-sentinel/src/main/java/com/alibaba/cloud/circuitbreaker/sentinel/ReactiveSentinelCircuitBreaker.java b/spring-cloud-circuitbreaker-sentinel/src/main/java/com/alibaba/cloud/circuitbreaker/sentinel/ReactiveSentinelCircuitBreaker.java new file mode 100644 index 00000000..e2cd8bf5 --- /dev/null +++ b/spring-cloud-circuitbreaker-sentinel/src/main/java/com/alibaba/cloud/circuitbreaker/sentinel/ReactiveSentinelCircuitBreaker.java @@ -0,0 +1,104 @@ +/* + * Copyright 2013-2019 the original author or authors. + * + * Licensed 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 + * + * https://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. + */ + +package com.alibaba.cloud.circuitbreaker.sentinel; + +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashSet; +import java.util.List; +import java.util.Set; +import java.util.function.Function; + +import com.alibaba.csp.sentinel.EntryType; +import com.alibaba.csp.sentinel.adapter.reactor.EntryConfig; +import com.alibaba.csp.sentinel.adapter.reactor.SentinelReactorTransformer; +import com.alibaba.csp.sentinel.slots.block.degrade.DegradeRule; +import com.alibaba.csp.sentinel.slots.block.degrade.DegradeRuleManager; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +import org.springframework.cloud.client.circuitbreaker.ReactiveCircuitBreaker; +import org.springframework.util.Assert; + +/** + * Sentinel implementation of {@link ReactiveCircuitBreaker}. + * + * @author Eric Zhao + */ +public class ReactiveSentinelCircuitBreaker implements ReactiveCircuitBreaker { + + private final String resourceName; + + private final EntryType entryType; + + private final List rules; + + public ReactiveSentinelCircuitBreaker(String resourceName, EntryType entryType, + List rules) { + Assert.hasText(resourceName, "resourceName cannot be blank"); + Assert.notNull(rules, "rules should not be null"); + this.resourceName = resourceName; + this.entryType = entryType; + this.rules = Collections.unmodifiableList(rules); + + applyToSentinelRuleManager(); + } + + public ReactiveSentinelCircuitBreaker(String resourceName, List rules) { + this(resourceName, EntryType.OUT, rules); + } + + public ReactiveSentinelCircuitBreaker(String resourceName) { + this(resourceName, EntryType.OUT, Collections.emptyList()); + } + + private void applyToSentinelRuleManager() { + if (this.rules == null || this.rules.isEmpty()) { + return; + } + Set ruleSet = new HashSet<>(DegradeRuleManager.getRules()); + for (DegradeRule rule : this.rules) { + if (rule == null) { + continue; + } + rule.setResource(resourceName); + ruleSet.add(rule); + } + DegradeRuleManager.loadRules(new ArrayList<>(ruleSet)); + } + + @Override + public Mono run(Mono toRun, Function> fallback) { + Mono toReturn = toRun.transform(new SentinelReactorTransformer<>( + new EntryConfig(resourceName, entryType))); + if (fallback != null) { + toReturn = toReturn.onErrorResume(fallback); + } + return toReturn; + } + + @Override + public Flux run(Flux toRun, Function> fallback) { + Flux toReturn = toRun.transform(new SentinelReactorTransformer<>( + new EntryConfig(resourceName, entryType))); + if (fallback != null) { + toReturn = toReturn.onErrorResume(fallback); + } + return toReturn; + } + +} \ No newline at end of file diff --git a/spring-cloud-circuitbreaker-sentinel/src/main/java/com/alibaba/cloud/circuitbreaker/sentinel/ReactiveSentinelCircuitBreakerAutoConfiguration.java b/spring-cloud-circuitbreaker-sentinel/src/main/java/com/alibaba/cloud/circuitbreaker/sentinel/ReactiveSentinelCircuitBreakerAutoConfiguration.java new file mode 100644 index 00000000..e4592e0b --- /dev/null +++ b/spring-cloud-circuitbreaker-sentinel/src/main/java/com/alibaba/cloud/circuitbreaker/sentinel/ReactiveSentinelCircuitBreakerAutoConfiguration.java @@ -0,0 +1,64 @@ +/* + * Copyright 2013-2019 the original author or authors. + * + * Licensed 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 + * + * https://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. + */ + +package com.alibaba.cloud.circuitbreaker.sentinel; + +import java.util.ArrayList; +import java.util.List; + +import javax.annotation.PostConstruct; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.autoconfigure.condition.ConditionalOnClass; +import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; +import org.springframework.cloud.client.circuitbreaker.Customizer; +import org.springframework.cloud.client.circuitbreaker.ReactiveCircuitBreakerFactory; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; + +/** + * @author Eric Zhao + */ +@Configuration +@ConditionalOnClass(name = { "reactor.core.publisher.Mono", + "reactor.core.publisher.Flux" }) +public class ReactiveSentinelCircuitBreakerAutoConfiguration { + + @Bean + @ConditionalOnMissingBean(ReactiveCircuitBreakerFactory.class) + public ReactiveCircuitBreakerFactory reactiveSentinelCircuitBreakerFactory() { + return new ReactiveSentinelCircuitBreakerFactory(); + } + + @Configuration + @ConditionalOnClass(name = { "reactor.core.publisher.Mono", + "reactor.core.publisher.Flux" }) + public static class ReactiveSentinelCustomizerConfiguration { + + @Autowired(required = false) + private List> customizers = new ArrayList<>(); + + @Autowired(required = false) + private ReactiveSentinelCircuitBreakerFactory factory; + + @PostConstruct + public void init() { + customizers.forEach(customizer -> customizer.customize(factory)); + } + + } + +} \ No newline at end of file diff --git a/spring-cloud-circuitbreaker-sentinel/src/main/java/com/alibaba/cloud/circuitbreaker/sentinel/ReactiveSentinelCircuitBreakerFactory.java b/spring-cloud-circuitbreaker-sentinel/src/main/java/com/alibaba/cloud/circuitbreaker/sentinel/ReactiveSentinelCircuitBreakerFactory.java new file mode 100644 index 00000000..5ebb97b3 --- /dev/null +++ b/spring-cloud-circuitbreaker-sentinel/src/main/java/com/alibaba/cloud/circuitbreaker/sentinel/ReactiveSentinelCircuitBreakerFactory.java @@ -0,0 +1,58 @@ +/* + * Copyright 2013-2019 the original author or authors. + * + * Licensed 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 + * + * https://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. + */ + +package com.alibaba.cloud.circuitbreaker.sentinel; + +import java.util.ArrayList; +import java.util.function.Function; + +import com.alibaba.cloud.circuitbreaker.sentinel.SentinelConfigBuilder.SentinelCircuitBreakerConfiguration; +import org.springframework.cloud.client.circuitbreaker.ReactiveCircuitBreaker; +import org.springframework.cloud.client.circuitbreaker.ReactiveCircuitBreakerFactory; +import org.springframework.util.Assert; + +/** + * Factory for {@link ReactiveSentinelCircuitBreaker}. + * + * @author Eric Zhao + */ +public class ReactiveSentinelCircuitBreakerFactory extends + ReactiveCircuitBreakerFactory { + + private Function defaultConfiguration = id -> new SentinelConfigBuilder() + .resourceName(id).rules(new ArrayList<>()).build(); + + @Override + public ReactiveCircuitBreaker create(String id) { + Assert.hasText(id, "A CircuitBreaker must have an id."); + SentinelConfigBuilder.SentinelCircuitBreakerConfiguration conf = getConfigurations() + .computeIfAbsent(id, defaultConfiguration); + return new ReactiveSentinelCircuitBreaker(id, conf.getEntryType(), + conf.getRules()); + } + + @Override + protected SentinelConfigBuilder configBuilder(String id) { + return new SentinelConfigBuilder(id); + } + + @Override + public void configureDefault( + Function defaultConfiguration) { + this.defaultConfiguration = defaultConfiguration; + } + +} \ No newline at end of file diff --git a/spring-cloud-circuitbreaker-sentinel/src/main/java/com/alibaba/cloud/circuitbreaker/sentinel/SentinelCircuitBreaker.java b/spring-cloud-circuitbreaker-sentinel/src/main/java/com/alibaba/cloud/circuitbreaker/sentinel/SentinelCircuitBreaker.java new file mode 100644 index 00000000..acbc7db3 --- /dev/null +++ b/spring-cloud-circuitbreaker-sentinel/src/main/java/com/alibaba/cloud/circuitbreaker/sentinel/SentinelCircuitBreaker.java @@ -0,0 +1,114 @@ +/* + * Copyright 2013-2019 the original author or authors. + * + * Licensed 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 + * + * https://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. + */ + +package com.alibaba.cloud.circuitbreaker.sentinel; + +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashSet; +import java.util.List; +import java.util.Set; +import java.util.function.Function; +import java.util.function.Supplier; + +import com.alibaba.csp.sentinel.Entry; +import com.alibaba.csp.sentinel.EntryType; +import com.alibaba.csp.sentinel.SphU; +import com.alibaba.csp.sentinel.Tracer; +import com.alibaba.csp.sentinel.slots.block.BlockException; +import com.alibaba.csp.sentinel.slots.block.degrade.DegradeRule; +import com.alibaba.csp.sentinel.slots.block.degrade.DegradeRuleManager; + +import org.springframework.cloud.client.circuitbreaker.CircuitBreaker; +import org.springframework.util.Assert; + +/** + * Sentinel implementation of {@link CircuitBreaker}. + * + * @author Eric Zhao + */ +public class SentinelCircuitBreaker implements CircuitBreaker { + + private final String resourceName; + + private final EntryType entryType; + + private final List rules; + + public SentinelCircuitBreaker(String resourceName, EntryType entryType, + List rules) { + Assert.hasText(resourceName, "resourceName cannot be blank"); + Assert.notNull(rules, "rules should not be null"); + this.resourceName = resourceName; + this.entryType = entryType; + this.rules = Collections.unmodifiableList(rules); + + applyToSentinelRuleManager(); + } + + public SentinelCircuitBreaker(String resourceName, List rules) { + this(resourceName, EntryType.OUT, rules); + } + + public SentinelCircuitBreaker(String resourceName) { + this(resourceName, EntryType.OUT, Collections.emptyList()); + } + + private void applyToSentinelRuleManager() { + if (this.rules == null || this.rules.isEmpty()) { + return; + } + Set ruleSet = new HashSet<>(DegradeRuleManager.getRules()); + for (DegradeRule rule : this.rules) { + if (rule == null) { + continue; + } + rule.setResource(resourceName); + ruleSet.add(rule); + } + DegradeRuleManager.loadRules(new ArrayList<>(ruleSet)); + } + + @Override + public T run(Supplier toRun, Function fallback) { + Entry entry = null; + try { + entry = SphU.entry(resourceName, entryType); + // If the SphU.entry() does not throw `BlockException`, it means that the + // request can pass. + return toRun.get(); + } + catch (BlockException ex) { + // SphU.entry() may throw BlockException which indicates that + // the request was rejected (flow control or circuit breaking triggered). + // So it should not be counted as the business exception. + return fallback.apply(ex); + } + catch (Exception ex) { + // For other kinds of exceptions, we'll trace the exception count via + // Tracer.trace(ex). + Tracer.trace(ex); + return fallback.apply(ex); + } + finally { + // Guarantee the invocation has been completed. + if (entry != null) { + entry.exit(); + } + } + } + +} \ No newline at end of file diff --git a/spring-cloud-circuitbreaker-sentinel/src/main/java/com/alibaba/cloud/circuitbreaker/sentinel/SentinelCircuitBreakerAutoConfiguration.java b/spring-cloud-circuitbreaker-sentinel/src/main/java/com/alibaba/cloud/circuitbreaker/sentinel/SentinelCircuitBreakerAutoConfiguration.java new file mode 100644 index 00000000..e8a96b93 --- /dev/null +++ b/spring-cloud-circuitbreaker-sentinel/src/main/java/com/alibaba/cloud/circuitbreaker/sentinel/SentinelCircuitBreakerAutoConfiguration.java @@ -0,0 +1,65 @@ +/* + * Copyright 2013-2019 the original author or authors. + * + * Licensed 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 + * + * https://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. + */ + +package com.alibaba.cloud.circuitbreaker.sentinel; + +import java.util.ArrayList; +import java.util.List; + +import javax.annotation.PostConstruct; + +import com.alibaba.csp.sentinel.SphU; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.autoconfigure.condition.ConditionalOnClass; +import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; +import org.springframework.cloud.client.circuitbreaker.CircuitBreakerFactory; +import org.springframework.cloud.client.circuitbreaker.Customizer; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; + +/** + * Auto configuration for {@link SentinelCircuitBreaker}. + * + * @author Eric Zhao + */ +@Configuration +@ConditionalOnClass({ SphU.class }) +public class SentinelCircuitBreakerAutoConfiguration { + + @Bean + @ConditionalOnMissingBean(CircuitBreakerFactory.class) + public CircuitBreakerFactory sentinelCircuitBreakerFactory() { + return new SentinelCircuitBreakerFactory(); + } + + @Configuration + public static class SentinelCustomizerConfiguration { + + @Autowired(required = false) + private List> customizers = new ArrayList<>(); + + @Autowired(required = false) + private SentinelCircuitBreakerFactory factory; + + @PostConstruct + public void init() { + customizers.forEach(customizer -> customizer.customize(factory)); + } + + } + +} \ No newline at end of file diff --git a/spring-cloud-circuitbreaker-sentinel/src/main/java/com/alibaba/cloud/circuitbreaker/sentinel/SentinelCircuitBreakerFactory.java b/spring-cloud-circuitbreaker-sentinel/src/main/java/com/alibaba/cloud/circuitbreaker/sentinel/SentinelCircuitBreakerFactory.java new file mode 100644 index 00000000..6b8b665e --- /dev/null +++ b/spring-cloud-circuitbreaker-sentinel/src/main/java/com/alibaba/cloud/circuitbreaker/sentinel/SentinelCircuitBreakerFactory.java @@ -0,0 +1,57 @@ +/* + * Copyright 2013-2019 the original author or authors. + * + * Licensed 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 + * + * https://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. + */ + +package com.alibaba.cloud.circuitbreaker.sentinel; + +import java.util.ArrayList; +import java.util.function.Function; + +import com.alibaba.csp.sentinel.EntryType; + +import com.alibaba.cloud.circuitbreaker.sentinel.SentinelConfigBuilder.SentinelCircuitBreakerConfiguration; +import org.springframework.cloud.client.circuitbreaker.CircuitBreaker; +import org.springframework.cloud.client.circuitbreaker.CircuitBreakerFactory; +import org.springframework.util.Assert; + +/** + * @author Eric Zhao + */ +public class SentinelCircuitBreakerFactory extends + CircuitBreakerFactory { + + private Function defaultConfiguration = id -> new SentinelConfigBuilder() + .resourceName(id).entryType(EntryType.OUT).rules(new ArrayList<>()).build(); + + @Override + public CircuitBreaker create(String id) { + Assert.hasText(id, "A CircuitBreaker must have an id."); + SentinelConfigBuilder.SentinelCircuitBreakerConfiguration conf = getConfigurations() + .computeIfAbsent(id, defaultConfiguration); + return new SentinelCircuitBreaker(id, conf.getEntryType(), conf.getRules()); + } + + @Override + protected SentinelConfigBuilder configBuilder(String id) { + return new SentinelConfigBuilder(id); + } + + @Override + public void configureDefault( + Function defaultConfiguration) { + this.defaultConfiguration = defaultConfiguration; + } + +} \ No newline at end of file diff --git a/spring-cloud-circuitbreaker-sentinel/src/main/java/com/alibaba/cloud/circuitbreaker/sentinel/SentinelConfigBuilder.java b/spring-cloud-circuitbreaker-sentinel/src/main/java/com/alibaba/cloud/circuitbreaker/sentinel/SentinelConfigBuilder.java new file mode 100644 index 00000000..35de0230 --- /dev/null +++ b/spring-cloud-circuitbreaker-sentinel/src/main/java/com/alibaba/cloud/circuitbreaker/sentinel/SentinelConfigBuilder.java @@ -0,0 +1,112 @@ +/* + * Copyright 2013-2019 the original author or authors. + * + * Licensed 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 + * + * https://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. + */ + +package com.alibaba.cloud.circuitbreaker.sentinel; + +import java.util.ArrayList; +import java.util.List; +import java.util.Optional; + +import com.alibaba.csp.sentinel.EntryType; +import com.alibaba.csp.sentinel.slots.block.degrade.DegradeRule; + +import org.springframework.cloud.client.circuitbreaker.ConfigBuilder; +import org.springframework.util.Assert; + +/** + * @author Eric Zhao + */ +public class SentinelConfigBuilder implements + ConfigBuilder { + + private String resourceName; + + private EntryType entryType; + + private List rules; + + public SentinelConfigBuilder() { + } + + public SentinelConfigBuilder(String resourceName) { + this.resourceName = resourceName; + } + + public SentinelConfigBuilder resourceName(String resourceName) { + this.resourceName = resourceName; + return this; + } + + public SentinelConfigBuilder entryType(EntryType entryType) { + this.entryType = entryType; + return this; + } + + public SentinelConfigBuilder rules(List rules) { + this.rules = rules; + return this; + } + + @Override + public SentinelCircuitBreakerConfiguration build() { + Assert.hasText(resourceName, "resourceName cannot be empty"); + List rules = Optional.ofNullable(this.rules) + .orElse(new ArrayList<>()); + + EntryType entryType = Optional.ofNullable(this.entryType).orElse(EntryType.OUT); + return new SentinelCircuitBreakerConfiguration() + .setResourceName(this.resourceName).setEntryType(entryType) + .setRules(rules); + } + + public static class SentinelCircuitBreakerConfiguration { + + private String resourceName; + + private EntryType entryType; + + private List rules; + + public String getResourceName() { + return resourceName; + } + + public SentinelCircuitBreakerConfiguration setResourceName(String resourceName) { + this.resourceName = resourceName; + return this; + } + + public EntryType getEntryType() { + return entryType; + } + + public SentinelCircuitBreakerConfiguration setEntryType(EntryType entryType) { + this.entryType = entryType; + return this; + } + + public List getRules() { + return rules; + } + + public SentinelCircuitBreakerConfiguration setRules(List rules) { + this.rules = rules; + return this; + } + + } + +} \ No newline at end of file diff --git a/spring-cloud-circuitbreaker-sentinel/src/main/resources/META-INF/spring.factories b/spring-cloud-circuitbreaker-sentinel/src/main/resources/META-INF/spring.factories new file mode 100644 index 00000000..1fdc6769 --- /dev/null +++ b/spring-cloud-circuitbreaker-sentinel/src/main/resources/META-INF/spring.factories @@ -0,0 +1,3 @@ +org.springframework.boot.autoconfigure.EnableAutoConfiguration=\ +com.alibaba.cloud.circuitbreaker.sentinel.SentinelCircuitBreakerAutoConfiguration,\ +com.alibaba.cloud.circuitbreaker.sentinel.ReactiveSentinelCircuitBreakerAutoConfiguration \ No newline at end of file diff --git a/spring-cloud-circuitbreaker-sentinel/src/test/java/com/alibaba/cloud/circuitbreaker/sentinel/ReactiveSentinelCircuitBreakerIntegrationTest.java b/spring-cloud-circuitbreaker-sentinel/src/test/java/com/alibaba/cloud/circuitbreaker/sentinel/ReactiveSentinelCircuitBreakerIntegrationTest.java new file mode 100644 index 00000000..b0a2b03a --- /dev/null +++ b/spring-cloud-circuitbreaker-sentinel/src/test/java/com/alibaba/cloud/circuitbreaker/sentinel/ReactiveSentinelCircuitBreakerIntegrationTest.java @@ -0,0 +1,207 @@ +/* + * Copyright 2013-2018 the original author or authors. + * + * Licensed 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 + * + * https://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. + */ + +package com.alibaba.cloud.circuitbreaker.sentinel; + +import java.time.Duration; +import java.util.Collections; + +import com.alibaba.csp.sentinel.slots.block.RuleConstant; +import com.alibaba.csp.sentinel.slots.block.degrade.DegradeRule; +import org.junit.Before; +import org.junit.Test; +import org.junit.runner.RunWith; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; +import reactor.test.StepVerifier; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.autoconfigure.EnableAutoConfiguration; +import org.springframework.boot.test.context.SpringBootTest; +import org.springframework.boot.web.server.LocalServerPort; +import org.springframework.cloud.client.circuitbreaker.Customizer; +import org.springframework.cloud.client.circuitbreaker.ReactiveCircuitBreakerFactory; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.core.ParameterizedTypeReference; +import org.springframework.stereotype.Service; +import org.springframework.test.annotation.DirtiesContext; +import org.springframework.test.context.junit4.SpringRunner; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RestController; +import org.springframework.web.reactive.function.client.WebClient; + +import static org.springframework.boot.test.context.SpringBootTest.WebEnvironment.RANDOM_PORT; + +/** + * @author Ryan Baxter + */ +@RunWith(SpringRunner.class) +@SpringBootTest(webEnvironment = RANDOM_PORT, classes = ReactiveSentinelCircuitBreakerIntegrationTest.Application.class) +@DirtiesContext +public class ReactiveSentinelCircuitBreakerIntegrationTest { + + @LocalServerPort + private int port = 0; + + @Autowired + private ReactiveSentinelCircuitBreakerIntegrationTest.Application.DemoControllerService service; + + @Before + public void setup() { + service.setPort(port); + } + + @Test + public void test() throws Exception { + StepVerifier.create(service.normal()).expectNext("normal").verifyComplete(); + StepVerifier.create(service.slow()).expectNext("slow").verifyComplete(); + StepVerifier.create(service.slow()).expectNext("slow").verifyComplete(); + StepVerifier.create(service.slow()).expectNext("slow").verifyComplete(); + StepVerifier.create(service.slow()).expectNext("slow").verifyComplete(); + StepVerifier.create(service.slow()).expectNext("slow").verifyComplete(); + + // Then in the next 5s, the fallback method should be called. + for (int i = 0; i < 5; i++) { + StepVerifier.create(service.slow()).expectNext("fallback").verifyComplete(); + Thread.sleep(1000); + } + + // Recovered. + StepVerifier.create(service.slow()).expectNext("slow").verifyComplete(); + + StepVerifier.create(service.normalFlux()).expectNext("normalflux") + .verifyComplete(); + StepVerifier.create(service.slowFlux()).expectNext("slowflux").verifyComplete(); + StepVerifier.create(service.slowFlux()).expectNext("slowflux").verifyComplete(); + StepVerifier.create(service.slowFlux()).expectNext("slowflux").verifyComplete(); + StepVerifier.create(service.slowFlux()).expectNext("slowflux").verifyComplete(); + StepVerifier.create(service.slowFlux()).expectNext("slowflux").verifyComplete(); + // Then in the next 5s, the fallback method should be called. + for (int i = 0; i < 5; i++) { + StepVerifier.create(service.slowFlux()).expectNext("flux_fallback") + .verifyComplete(); + Thread.sleep(1000); + } + + // Recovered. + StepVerifier.create(service.slowFlux()).expectNext("slowflux").verifyComplete(); + } + + @Configuration + @EnableAutoConfiguration + @RestController + protected static class Application { + + @GetMapping("/slow") + public Mono slow() { + return Mono.just("slow").delayElement(Duration.ofMillis(500)); + } + + @GetMapping("/normal") + public Mono normal() { + return Mono.just("normal"); + } + + @GetMapping("/slow_flux") + public Flux slowFlux() { + return Flux.just("slow", "flux").delayElements(Duration.ofMillis(500)); + } + + @GetMapping("normal_flux") + public Flux normalFlux() { + return Flux.just("normal", "flux"); + } + + @Bean + public Customizer slowCustomizer() { + return factory -> { + factory.configure(builder -> builder + .rules(Collections.singletonList(new DegradeRule("slow_mono") + .setGrade(RuleConstant.DEGRADE_GRADE_RT).setCount(100) + .setTimeWindow(5))), + "slow_mono"); + factory.configure(builder -> builder + .rules(Collections.singletonList(new DegradeRule("slow_flux") + .setGrade(RuleConstant.DEGRADE_GRADE_RT).setCount(100) + .setTimeWindow(5))), + "slow_flux"); + factory.configureDefault(id -> new SentinelConfigBuilder() + .resourceName(id) + .rules(Collections.singletonList(new DegradeRule(id) + .setGrade(RuleConstant.DEGRADE_GRADE_EXCEPTION_COUNT) + .setCount(0.5).setTimeWindow(10))) + .build()); + }; + } + + @Service + public static class DemoControllerService { + + private int port = 0; + + private ReactiveCircuitBreakerFactory cbFactory; + + DemoControllerService(ReactiveCircuitBreakerFactory cbFactory) { + this.cbFactory = cbFactory; + } + + public Mono slow() { + return WebClient.builder().baseUrl("http://localhost:" + port).build() + .get().uri("/slow").retrieve().bodyToMono(String.class) + .transform(it -> cbFactory.create("slow_mono").run(it, t -> { + t.printStackTrace(); + return Mono.just("fallback"); + })); + } + + public Mono normal() { + return WebClient.builder().baseUrl("http://localhost:" + port).build() + .get().uri("/normal").retrieve().bodyToMono(String.class) + .transform(it -> cbFactory.create("normal_mono").run(it, t -> { + t.printStackTrace(); + return Mono.just("fallback"); + })); + } + + public Flux slowFlux() { + return WebClient.builder().baseUrl("http://localhost:" + port).build() + .get().uri("/slow_flux").retrieve() + .bodyToFlux(new ParameterizedTypeReference() { + }).transform(it -> cbFactory.create("slow_flux").run(it, t -> { + t.printStackTrace(); + return Flux.just("flux_fallback"); + })); + } + + public Flux normalFlux() { + return WebClient.builder().baseUrl("http://localhost:" + port).build() + .get().uri("/normal_flux").retrieve().bodyToFlux(String.class) + .transform(it -> cbFactory.create("normal_flux").run(it, t -> { + t.printStackTrace(); + return Flux.just("flux_fallback"); + })); + } + + public void setPort(int port) { + this.port = port; + } + + } + + } + +} \ No newline at end of file diff --git a/spring-cloud-circuitbreaker-sentinel/src/test/java/com/alibaba/cloud/circuitbreaker/sentinel/ReactiveSentinelCircuitBreakerTest.java b/spring-cloud-circuitbreaker-sentinel/src/test/java/com/alibaba/cloud/circuitbreaker/sentinel/ReactiveSentinelCircuitBreakerTest.java new file mode 100644 index 00000000..63a65064 --- /dev/null +++ b/spring-cloud-circuitbreaker-sentinel/src/test/java/com/alibaba/cloud/circuitbreaker/sentinel/ReactiveSentinelCircuitBreakerTest.java @@ -0,0 +1,80 @@ +/* + * Copyright 2013-2019 the original author or authors. + * + * Licensed 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 + * + * https://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. + */ + +package com.alibaba.cloud.circuitbreaker.sentinel; + +import java.util.Arrays; +import java.util.Collections; + +import com.alibaba.csp.sentinel.slots.block.degrade.DegradeRuleManager; +import org.junit.Test; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +import org.springframework.cloud.client.circuitbreaker.ReactiveCircuitBreaker; + +import static org.assertj.core.api.Assertions.assertThat; + +/** + * @author Eric Zhao + */ +public class ReactiveSentinelCircuitBreakerTest { + + @Test + public void testCreateWithNullRule() { + String id = "testCreateReactiveCbWithNullRule"; + ReactiveSentinelCircuitBreaker cb = new ReactiveSentinelCircuitBreaker(id, + Collections.singletonList(null)); + assertThat(Mono.just("foobar").transform(it -> cb.run(it)).block()) + .isEqualTo("foobar"); + assertThat(DegradeRuleManager.hasConfig(id)).isFalse(); + } + + @Test + public void runMono() { + ReactiveCircuitBreaker cb = new ReactiveSentinelCircuitBreakerFactory() + .create("foo"); + assertThat(Mono.just("foobar").transform(it -> cb.run(it)).block()) + .isEqualTo("foobar"); + } + + @Test + public void runMonoWithFallback() { + ReactiveCircuitBreaker cb = new ReactiveSentinelCircuitBreakerFactory() + .create("foo"); + assertThat(Mono.error(new RuntimeException("boom")) + .transform(it -> cb.run(it, t -> Mono.just("fallback"))).block()) + .isEqualTo("fallback"); + } + + @Test + public void runFlux() { + ReactiveCircuitBreaker cb = new ReactiveSentinelCircuitBreakerFactory() + .create("foo"); + assertThat(Flux.just("foobar", "hello world").transform(it -> cb.run(it)) + .collectList().block()).isEqualTo(Arrays.asList("foobar", "hello world")); + } + + @Test + public void runFluxWithFallback() { + ReactiveCircuitBreaker cb = new ReactiveSentinelCircuitBreakerFactory() + .create("foo"); + assertThat(Flux.error(new RuntimeException("boom")) + .transform(it -> cb.run(it, t -> Flux.just("fallback"))).collectList() + .block()).isEqualTo(Arrays.asList("fallback")); + } + +} \ No newline at end of file diff --git a/spring-cloud-circuitbreaker-sentinel/src/test/java/com/alibaba/cloud/circuitbreaker/sentinel/SentinelCircuitBreakerIntegrationTest.java b/spring-cloud-circuitbreaker-sentinel/src/test/java/com/alibaba/cloud/circuitbreaker/sentinel/SentinelCircuitBreakerIntegrationTest.java new file mode 100644 index 00000000..7c1e57eb --- /dev/null +++ b/spring-cloud-circuitbreaker-sentinel/src/test/java/com/alibaba/cloud/circuitbreaker/sentinel/SentinelCircuitBreakerIntegrationTest.java @@ -0,0 +1,153 @@ +/* + * Copyright 2013-2019 the original author or authors. + * + * Licensed 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 + * + * https://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. + */ + +package com.alibaba.cloud.circuitbreaker.sentinel; + +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; + +import com.alibaba.csp.sentinel.slots.block.RuleConstant; +import com.alibaba.csp.sentinel.slots.block.degrade.DegradeRule; +import com.alibaba.csp.sentinel.slots.block.degrade.DegradeRuleManager; +import org.junit.Before; +import org.junit.Test; +import org.junit.runner.RunWith; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.autoconfigure.EnableAutoConfiguration; +import org.springframework.boot.test.context.SpringBootTest; +import org.springframework.boot.test.web.client.TestRestTemplate; +import org.springframework.cloud.client.circuitbreaker.CircuitBreakerFactory; +import org.springframework.cloud.client.circuitbreaker.Customizer; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.stereotype.Service; +import org.springframework.test.annotation.DirtiesContext; +import org.springframework.test.context.junit4.SpringRunner; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RestController; + +import static org.assertj.core.api.Assertions.assertThat; +import static org.springframework.boot.test.context.SpringBootTest.WebEnvironment.RANDOM_PORT; + +/** + * @author Eric Zhao + */ +@RunWith(SpringRunner.class) +@SpringBootTest(webEnvironment = RANDOM_PORT, classes = SentinelCircuitBreakerIntegrationTest.Application.class) +@DirtiesContext +public class SentinelCircuitBreakerIntegrationTest { + + @Autowired + private Application.DemoControllerService service; + + @Test + public void testSlow() throws Exception { + // The first 5 requests should pass. + assertThat(service.slow()).isEqualTo("slow"); + assertThat(service.slow()).isEqualTo("slow"); + assertThat(service.slow()).isEqualTo("slow"); + assertThat(service.slow()).isEqualTo("slow"); + assertThat(service.slow()).isEqualTo("slow"); + + // Then in the next 10s, the fallback method should be called. + for (int i = 0; i < 10; i++) { + assertThat(service.slow()).isEqualTo("fallback"); + Thread.sleep(1000); + } + + // Recovered. + assertThat(service.slow()).isEqualTo("slow"); + } + + @Test + public void testNormal() { + assertThat(service.normal()).isEqualTo("normal"); + } + + @Before + public void setUp() { + DegradeRuleManager.loadRules(new ArrayList<>()); + } + + @Before + public void tearDown() { + DegradeRuleManager.loadRules(new ArrayList<>()); + } + + @Configuration + @EnableAutoConfiguration + @RestController + protected static class Application { + + @GetMapping("/slow") + public String slow() throws InterruptedException { + Thread.sleep(500); + return "slow"; + } + + @GetMapping("/normal") + public String normal() { + return "normal"; + } + + @Bean + public Customizer slowCustomizer() { + String slowId = "slow"; + List rules = Collections.singletonList( + new DegradeRule(slowId).setGrade(RuleConstant.DEGRADE_GRADE_RT) + .setCount(100).setTimeWindow(10)); + return factory -> { + factory.configure(builder -> builder.rules(rules), slowId); + factory.configureDefault(id -> new SentinelConfigBuilder() + .resourceName(id) + .rules(Collections.singletonList(new DegradeRule(id) + .setGrade(RuleConstant.DEGRADE_GRADE_EXCEPTION_COUNT) + .setCount(0.5).setTimeWindow(10))) + .build()); + }; + } + + @Service + public static class DemoControllerService { + + private TestRestTemplate rest; + + private CircuitBreakerFactory cbFactory; + + DemoControllerService(TestRestTemplate rest, + CircuitBreakerFactory cbFactory) { + this.rest = rest; + this.cbFactory = cbFactory; + } + + public String slow() { + return cbFactory.create("slow").run( + () -> rest.getForObject("/slow", String.class), t -> "fallback"); + } + + public String normal() { + return cbFactory.create("normal").run( + () -> rest.getForObject("/normal", String.class), + t -> "fallback"); + } + + } + + } + +} \ No newline at end of file diff --git a/spring-cloud-circuitbreaker-sentinel/src/test/java/com/alibaba/cloud/circuitbreaker/sentinel/SentinelCircuitBreakerTest.java b/spring-cloud-circuitbreaker-sentinel/src/test/java/com/alibaba/cloud/circuitbreaker/sentinel/SentinelCircuitBreakerTest.java new file mode 100644 index 00000000..8dba3efd --- /dev/null +++ b/spring-cloud-circuitbreaker-sentinel/src/test/java/com/alibaba/cloud/circuitbreaker/sentinel/SentinelCircuitBreakerTest.java @@ -0,0 +1,86 @@ +/* + * Copyright 2013-2019 the original author or authors. + * + * Licensed 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 + * + * https://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. + */ + +package com.alibaba.cloud.circuitbreaker.sentinel; + +import java.util.ArrayList; +import java.util.Collections; + +import com.alibaba.csp.sentinel.slots.block.degrade.DegradeRule; +import com.alibaba.csp.sentinel.slots.block.degrade.DegradeRuleManager; + +import org.junit.After; +import org.junit.Test; + +import org.springframework.cloud.client.circuitbreaker.CircuitBreaker; + +import static org.assertj.core.api.Assertions.assertThat; + +/** + * @author Eric Zhao + */ +public class SentinelCircuitBreakerTest { + + @After + public void tearDown() { + // Clear the rules. + DegradeRuleManager.loadRules(new ArrayList<>()); + } + + @Test + public void testCreateDirectlyThenRun() { + // Create a circuit breaker without any circuit breaking rules. + CircuitBreaker cb = new SentinelCircuitBreaker( + "testSentinelCreateDirectlyThenRunA"); + assertThat(cb.run(() -> "Sentinel")).isEqualTo("Sentinel"); + assertThat(DegradeRuleManager.hasConfig("testSentinelCreateDirectlyThenRunA")) + .isFalse(); + + CircuitBreaker cb2 = new SentinelCircuitBreaker( + "testSentinelCreateDirectlyThenRunB", + Collections.singletonList( + new DegradeRule("testSentinelCreateDirectlyThenRunB") + .setCount(100).setTimeWindow(10))); + assertThat(cb2.run(() -> "Sentinel")).isEqualTo("Sentinel"); + assertThat(DegradeRuleManager.hasConfig("testSentinelCreateDirectlyThenRunB")) + .isTrue(); + } + + @Test + public void testCreateWithNullRule() { + String id = "testCreateCbWithNullRule"; + CircuitBreaker cb = new SentinelCircuitBreaker(id, + Collections.singletonList(null)); + assertThat(cb.run(() -> "Sentinel")).isEqualTo("Sentinel"); + assertThat(DegradeRuleManager.hasConfig(id)).isFalse(); + } + + @Test + public void testCreateFromFactoryThenRun() { + CircuitBreaker cb = new SentinelCircuitBreakerFactory().create("testSentinelRun"); + assertThat(cb.run(() -> "foobar")).isEqualTo("foobar"); + } + + @Test + public void testRunWithFallback() { + CircuitBreaker cb = new SentinelCircuitBreakerFactory() + .create("testSentinelRunWithFallback"); + assertThat(cb. run(() -> { + throw new RuntimeException("boom"); + }, t -> "fallback")).isEqualTo("fallback"); + } + +} \ No newline at end of file diff --git a/spring-cloud-starter-alibaba/pom.xml b/spring-cloud-starter-alibaba/pom.xml index 9cfb5133..47f3f65e 100644 --- a/spring-cloud-starter-alibaba/pom.xml +++ b/spring-cloud-starter-alibaba/pom.xml @@ -4,7 +4,7 @@ com.alibaba.cloud spring-cloud-alibaba - 2.1.1.BUILD-SNAPSHOT + 2.2.0.BUILD-SNAPSHOT ../pom.xml spring-cloud-starter-alibaba diff --git a/spring-cloud-starter-alibaba/spring-cloud-starter-alibaba-nacos-config-server/pom.xml b/spring-cloud-starter-alibaba/spring-cloud-starter-alibaba-nacos-config-server/pom.xml index f6013446..fd731f83 100644 --- a/spring-cloud-starter-alibaba/spring-cloud-starter-alibaba-nacos-config-server/pom.xml +++ b/spring-cloud-starter-alibaba/spring-cloud-starter-alibaba-nacos-config-server/pom.xml @@ -5,7 +5,7 @@ com.alibaba.cloud spring-cloud-starter-alibaba - 2.1.1.BUILD-SNAPSHOT + 2.2.0.BUILD-SNAPSHOT spring-cloud-starter-alibaba-nacos-config-server Spring Cloud Starter Alibaba Nacos Config Server diff --git a/spring-cloud-starter-alibaba/spring-cloud-starter-alibaba-nacos-config/pom.xml b/spring-cloud-starter-alibaba/spring-cloud-starter-alibaba-nacos-config/pom.xml index 0f9ca32d..af2293da 100644 --- a/spring-cloud-starter-alibaba/spring-cloud-starter-alibaba-nacos-config/pom.xml +++ b/spring-cloud-starter-alibaba/spring-cloud-starter-alibaba-nacos-config/pom.xml @@ -5,7 +5,7 @@ com.alibaba.cloud spring-cloud-starter-alibaba - 2.1.1.BUILD-SNAPSHOT + 2.2.0.BUILD-SNAPSHOT spring-cloud-starter-alibaba-nacos-config Spring Cloud Starter Alibaba Nacos Config diff --git a/spring-cloud-starter-alibaba/spring-cloud-starter-alibaba-nacos-discovery/pom.xml b/spring-cloud-starter-alibaba/spring-cloud-starter-alibaba-nacos-discovery/pom.xml index 9a4c6d72..bca5944a 100644 --- a/spring-cloud-starter-alibaba/spring-cloud-starter-alibaba-nacos-discovery/pom.xml +++ b/spring-cloud-starter-alibaba/spring-cloud-starter-alibaba-nacos-discovery/pom.xml @@ -5,7 +5,7 @@ com.alibaba.cloud spring-cloud-starter-alibaba - 2.1.1.BUILD-SNAPSHOT + 2.2.0.BUILD-SNAPSHOT spring-cloud-starter-alibaba-nacos-discovery Spring Cloud Starter Alibaba Nacos Discovery diff --git a/spring-cloud-starter-alibaba/spring-cloud-starter-alibaba-seata/pom.xml b/spring-cloud-starter-alibaba/spring-cloud-starter-alibaba-seata/pom.xml index 64c25d06..4e98871a 100644 --- a/spring-cloud-starter-alibaba/spring-cloud-starter-alibaba-seata/pom.xml +++ b/spring-cloud-starter-alibaba/spring-cloud-starter-alibaba-seata/pom.xml @@ -5,7 +5,7 @@ com.alibaba.cloud spring-cloud-starter-alibaba - 2.1.1.BUILD-SNAPSHOT + 2.2.0.BUILD-SNAPSHOT spring-cloud-starter-alibaba-seata Spring Cloud Starter Alibaba Seata diff --git a/spring-cloud-starter-alibaba/spring-cloud-starter-alibaba-sentinel/pom.xml b/spring-cloud-starter-alibaba/spring-cloud-starter-alibaba-sentinel/pom.xml index db1ec624..4a8c488b 100644 --- a/spring-cloud-starter-alibaba/spring-cloud-starter-alibaba-sentinel/pom.xml +++ b/spring-cloud-starter-alibaba/spring-cloud-starter-alibaba-sentinel/pom.xml @@ -5,7 +5,7 @@ com.alibaba.cloud spring-cloud-starter-alibaba - 2.1.1.BUILD-SNAPSHOT + 2.2.0.BUILD-SNAPSHOT spring-cloud-starter-alibaba-sentinel Spring Cloud Starter Alibaba Sentinel diff --git a/spring-cloud-starter-alibaba/spring-cloud-starter-bus-rocketmq/pom.xml b/spring-cloud-starter-alibaba/spring-cloud-starter-bus-rocketmq/pom.xml index efd7a14f..cade314e 100644 --- a/spring-cloud-starter-alibaba/spring-cloud-starter-bus-rocketmq/pom.xml +++ b/spring-cloud-starter-alibaba/spring-cloud-starter-bus-rocketmq/pom.xml @@ -5,7 +5,7 @@ com.alibaba.cloud spring-cloud-starter-alibaba - 2.1.1.BUILD-SNAPSHOT + 2.2.0.BUILD-SNAPSHOT ../pom.xml 4.0.0 diff --git a/spring-cloud-starter-alibaba/spring-cloud-starter-dubbo/pom.xml b/spring-cloud-starter-alibaba/spring-cloud-starter-dubbo/pom.xml index 28511ce4..042cd584 100644 --- a/spring-cloud-starter-alibaba/spring-cloud-starter-dubbo/pom.xml +++ b/spring-cloud-starter-alibaba/spring-cloud-starter-dubbo/pom.xml @@ -5,7 +5,7 @@ com.alibaba.cloud spring-cloud-starter-alibaba - 2.1.1.BUILD-SNAPSHOT + 2.2.0.BUILD-SNAPSHOT ../pom.xml 4.0.0 diff --git a/spring-cloud-starter-alibaba/spring-cloud-starter-stream-rocketmq/pom.xml b/spring-cloud-starter-alibaba/spring-cloud-starter-stream-rocketmq/pom.xml index c8eddc61..61dac104 100644 --- a/spring-cloud-starter-alibaba/spring-cloud-starter-stream-rocketmq/pom.xml +++ b/spring-cloud-starter-alibaba/spring-cloud-starter-stream-rocketmq/pom.xml @@ -5,7 +5,7 @@ com.alibaba.cloud spring-cloud-starter-alibaba - 2.1.1.BUILD-SNAPSHOT + 2.2.0.BUILD-SNAPSHOT ../pom.xml spring-cloud-starter-stream-rocketmq diff --git a/spring-cloud-starter-alicloud/pom.xml b/spring-cloud-starter-alicloud/pom.xml index 4ee2d7be..ba0d4985 100644 --- a/spring-cloud-starter-alicloud/pom.xml +++ b/spring-cloud-starter-alicloud/pom.xml @@ -4,7 +4,7 @@ com.alibaba.cloud spring-cloud-alibaba - 2.1.1.BUILD-SNAPSHOT + 2.2.0.BUILD-SNAPSHOT spring-cloud-starter-alicloud pom diff --git a/spring-cloud-starter-alicloud/spring-cloud-starter-alicloud-acm/pom.xml b/spring-cloud-starter-alicloud/spring-cloud-starter-alicloud-acm/pom.xml index 2417d872..dfda39d6 100644 --- a/spring-cloud-starter-alicloud/spring-cloud-starter-alicloud-acm/pom.xml +++ b/spring-cloud-starter-alicloud/spring-cloud-starter-alicloud-acm/pom.xml @@ -5,7 +5,7 @@ com.alibaba.cloud spring-cloud-starter-alicloud - 2.1.1.BUILD-SNAPSHOT + 2.2.0.BUILD-SNAPSHOT spring-cloud-starter-alicloud-acm Spring Cloud Starter Alibaba Cloud ACM diff --git a/spring-cloud-starter-alicloud/spring-cloud-starter-alicloud-ans/pom.xml b/spring-cloud-starter-alicloud/spring-cloud-starter-alicloud-ans/pom.xml index cbbce151..78aa43bc 100644 --- a/spring-cloud-starter-alicloud/spring-cloud-starter-alicloud-ans/pom.xml +++ b/spring-cloud-starter-alicloud/spring-cloud-starter-alicloud-ans/pom.xml @@ -5,7 +5,7 @@ com.alibaba.cloud spring-cloud-starter-alicloud - 2.1.1.BUILD-SNAPSHOT + 2.2.0.BUILD-SNAPSHOT spring-cloud-starter-alicloud-ans diff --git a/spring-cloud-starter-alicloud/spring-cloud-starter-alicloud-oss/pom.xml b/spring-cloud-starter-alicloud/spring-cloud-starter-alicloud-oss/pom.xml index 2d8ef360..f398626d 100644 --- a/spring-cloud-starter-alicloud/spring-cloud-starter-alicloud-oss/pom.xml +++ b/spring-cloud-starter-alicloud/spring-cloud-starter-alicloud-oss/pom.xml @@ -5,7 +5,7 @@ com.alibaba.cloud spring-cloud-starter-alicloud - 2.1.1.BUILD-SNAPSHOT + 2.2.0.BUILD-SNAPSHOT spring-cloud-starter-alicloud-oss Spring Cloud Starter Alibaba Cloud OSS diff --git a/spring-cloud-starter-alicloud/spring-cloud-starter-alicloud-schedulerx/pom.xml b/spring-cloud-starter-alicloud/spring-cloud-starter-alicloud-schedulerx/pom.xml index a9fbdf9c..8576fe37 100644 --- a/spring-cloud-starter-alicloud/spring-cloud-starter-alicloud-schedulerx/pom.xml +++ b/spring-cloud-starter-alicloud/spring-cloud-starter-alicloud-schedulerx/pom.xml @@ -5,7 +5,7 @@ com.alibaba.cloud spring-cloud-starter-alicloud - 2.1.1.BUILD-SNAPSHOT + 2.2.0.BUILD-SNAPSHOT spring-cloud-starter-alicloud-schedulerx Spring Cloud Starter Alibaba Cloud SchedulerX diff --git a/spring-cloud-starter-alicloud/spring-cloud-starter-alicloud-sms/pom.xml b/spring-cloud-starter-alicloud/spring-cloud-starter-alicloud-sms/pom.xml index 226977da..3a64a948 100644 --- a/spring-cloud-starter-alicloud/spring-cloud-starter-alicloud-sms/pom.xml +++ b/spring-cloud-starter-alicloud/spring-cloud-starter-alicloud-sms/pom.xml @@ -5,7 +5,7 @@ com.alibaba.cloud spring-cloud-starter-alicloud - 2.1.1.BUILD-SNAPSHOT + 2.2.0.BUILD-SNAPSHOT spring-cloud-starter-alicloud-sms Spring Cloud Starter Alibaba Cloud SMS diff --git a/spring-cloud-stream-binder-rocketmq/pom.xml b/spring-cloud-stream-binder-rocketmq/pom.xml index 9b09fc4c..40235759 100644 --- a/spring-cloud-stream-binder-rocketmq/pom.xml +++ b/spring-cloud-stream-binder-rocketmq/pom.xml @@ -5,7 +5,7 @@ com.alibaba.cloud spring-cloud-alibaba - 2.1.1.BUILD-SNAPSHOT + 2.2.0.BUILD-SNAPSHOT ../pom.xml 4.0.0 diff --git a/spring-cloud-stream-binder-rocketmq/src/main/java/com/alibaba/cloud/stream/binder/rocketmq/integration/RocketMQMessageHandler.java b/spring-cloud-stream-binder-rocketmq/src/main/java/com/alibaba/cloud/stream/binder/rocketmq/integration/RocketMQMessageHandler.java index ec5c4c6e..000754bf 100644 --- a/spring-cloud-stream-binder-rocketmq/src/main/java/com/alibaba/cloud/stream/binder/rocketmq/integration/RocketMQMessageHandler.java +++ b/spring-cloud-stream-binder-rocketmq/src/main/java/com/alibaba/cloud/stream/binder/rocketmq/integration/RocketMQMessageHandler.java @@ -151,8 +151,8 @@ public class RocketMQMessageHandler extends AbstractMessageHandler implements Li } @Override - protected void handleMessageInternal(org.springframework.messaging.Message message) - throws Exception { + protected void handleMessageInternal( + org.springframework.messaging.Message message) { try { // issue 737 fix Map jsonHeaders = headerMapper