From 6a0932a097863ddc104669a9364433039c871ed1 Mon Sep 17 00:00:00 2001 From: chentianming Date: Fri, 6 May 2022 11:01:15 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8DJDK1.8=20SpringBoot=E5=90=AF?= =?UTF-8?q?=E5=8A=A8=E5=87=BA=E7=8E=B0typenotpresentexceptionproxy?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 6 ++---- pom.xml | 2 +- .../spring/boot/config/RetrofitAutoConfiguration.java | 6 ++---- 3 files changed, 5 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index 1c664d0..d86265d 100644 --- a/README.md +++ b/README.md @@ -51,14 +51,12 @@ gitee项目地址:[https://gitee.com/lianjiatech/retrofit-spring-boot-starter] com.github.lianjiatech retrofit-spring-boot-starter - 2.3.0 + 2.3.1 ``` > **强烈建议使用最新版本,稳定无bug!** -> **`2.2.13`和`2.2.14`对配置中心有兼容性bug,请勿使用!!!** - **本项目依赖Retrofit-2.9.0,okhttp-3.14.9,okio-1.17.5版本,如果冲突,烦请手动引入相关jar包**。完整依赖如下: @@ -66,7 +64,7 @@ gitee项目地址:[https://gitee.com/lianjiatech/retrofit-spring-boot-starter] com.github.lianjiatech retrofit-spring-boot-starter - 2.3.0 + 2.3.1 com.squareup.okhttp3 diff --git a/pom.xml b/pom.xml index 9f096d5..79e827c 100644 --- a/pom.xml +++ b/pom.xml @@ -6,7 +6,7 @@ com.github.lianjiatech retrofit-spring-boot-starter - 2.3.0 + 2.3.1 retrofit-spring-boot-starter retrofit-spring-boot-starter diff --git a/src/main/java/com/github/lianjiatech/retrofit/spring/boot/config/RetrofitAutoConfiguration.java b/src/main/java/com/github/lianjiatech/retrofit/spring/boot/config/RetrofitAutoConfiguration.java index 0cfc163..9a36a46 100644 --- a/src/main/java/com/github/lianjiatech/retrofit/spring/boot/config/RetrofitAutoConfiguration.java +++ b/src/main/java/com/github/lianjiatech/retrofit/spring/boot/config/RetrofitAutoConfiguration.java @@ -14,7 +14,6 @@ import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Import; -import com.alibaba.csp.sentinel.SphU; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.databind.DeserializationFeature; import com.fasterxml.jackson.databind.ObjectMapper; @@ -36,7 +35,6 @@ import com.github.lianjiatech.retrofit.spring.boot.log.LoggingInterceptor; import com.github.lianjiatech.retrofit.spring.boot.retry.RetryInterceptor; -import io.github.resilience4j.circuitbreaker.CircuitBreaker; import io.github.resilience4j.circuitbreaker.CircuitBreakerRegistry; import okhttp3.ConnectionPool; import retrofit2.converter.jackson.JacksonConverterFactory; @@ -146,7 +144,7 @@ ServiceChooseInterceptor serviceChooseInterceptor(@Autowired ServiceInstanceChoo @Bean @ConditionalOnMissingBean - @ConditionalOnClass(SphU.class) + @ConditionalOnClass(name = "com.alibaba.csp.sentinel.SphU") @ConditionalOnProperty(name = "retrofit.degrade.degrade-type", havingValue = RetrofitDegrade.SENTINEL) public RetrofitDegrade sentinelRetrofitDegrade() { return new SentinelRetrofitDegrade(); @@ -154,7 +152,7 @@ public RetrofitDegrade sentinelRetrofitDegrade() { @Bean @ConditionalOnMissingBean - @ConditionalOnClass(CircuitBreaker.class) + @ConditionalOnClass(name = "io.github.resilience4j.circuitbreaker.CircuitBreaker") @ConditionalOnProperty(name = "retrofit.degrade.degrade-type", havingValue = RetrofitDegrade.RESILIENCE4J) public RetrofitDegrade resilience4jRetrofitDegrade() { return new Resilience4jRetrofitDegrade(CircuitBreakerRegistry.ofDefaults());