SpringCloud2020踩坑记

About the annotation @EnableCircuitBreaker in spring cloud 2020

异常信息

 java.lang.IllegalStateException: Annotation @EnableCircuitBreaker found, but there are no implementations. Did you forget to include a starter?
at org.springframework.cloud.commons.util.SpringFactoryImportSelector.selectImports(SpringFactoryImportSelector.java:77) ~[spring-cloud-commons-3.0.0-M6.jar:3.0.0-M6]
at org.springframework.context.annotation.ConfigurationClassParser$DefaultDeferredImportSelectorGroup.process(ConfigurationClassParser.java:904) ~[spring-context-5.3.1.jar:5.3.1]

在SpringCloud2020的早起版本中,CircuitBreaker的实现都是基于SpringCloud 2.x的,可以理解为暂时还没有CircuitBreaker的实现。
解决办法:暂时不用@EnableCircuitBreaker,注意@SpringCloudApplication由@EnableDiscoveryClient和@EnableCircuitBreaker组成,会隐式开启CircuitBreaker
参考:https://github.com/spring-cloud/spring-cloud-commons/issues/863

你可能感兴趣的:(SpringCloud,java,spring,springcloud)