Nepxion / Discovery

☀️ Nepxion Discovery is a solution for Spring Cloud with blue green, gray, route, limitation, circuit breaker, degrade, isolation, tracing, dye, failover, active 蓝绿灰度发布、路由、限流、熔断、降级、隔离、追踪、流量染色、故障转移、多活
http://www.nepxion.com
Apache License 2.0
5.64k stars 1.43k forks source link

spring cloud 引入问题 #169

Closed renyp-veteran closed 3 years ago

renyp-veteran commented 3 years ago

您好! 最近公司项目(spring cloud项目 注册中心:nacos、 配置中心:apollo、网关:gateway)引入灰度发布,看到了Nepxion Discovery项目很感兴趣。尝试在已有项目中引入,导入依赖后抛出异常

因为本身项目用nacos注册中心,所以关于nacos依赖已经存在,暂时回避和discovery引入nacos冲突,我使用了

spring: main: allow-bean-definition-overriding: true

来回避冲突问题。 但是启动项目还是抛出了一下异常

java.lang.IllegalStateException: Error processing condition on com.alibaba.cloud.nacos.discovery.reactive.NacosReactiveDiscoveryClientConfiguration.nacosReactiveDiscoveryClient

Caused by: java.lang.IllegalStateException: @ConditionalOnMissingBean did not specify a bean using type, name or annotation and the attempt to deduce the bean's type failed

Caused by: org.springframework.boot.autoconfigure.condition.OnBeanCondition$BeanTypeDeductionException: Failed to deduce bean type for com.alibaba.cloud.nacos.discovery.reactive.NacosReactiveDiscoveryClientConfiguration.nacosReactiveDiscoveryClient

Caused by: java.lang.NoClassDefFoundError: org/springframework/cloud/client/discovery/ReactiveDiscoveryClient

Caused by: java.lang.ClassNotFoundException: org.springframework.cloud.client.discovery.ReactiveDiscoveryClient

renyp-veteran commented 3 years ago

引入的依赖

微信截图_20210707183429 微信截图_20210707183444

HaojunRen commented 3 years ago

你使用的Spring Cloud是哪个版本?

HaojunRen commented 3 years ago

H版以及以下版本,Nepxion只支持Ribbon负载均衡,不支持Reactor负载均衡,2020以上的版本才支持

renyp-veteran commented 3 years ago

H版以及以下版本,Nepxion只支持Ribbon负载均衡,不支持Reactor负载均衡,2020以上的版本才支持

好的,我对比一下版本,感谢

renyp-veteran commented 3 years ago

公司用的是Spring cloud G版,怎样解决上面提到的引入Nepxion Discovery的冲突问题?

HaojunRen commented 3 years ago

F,G,H都可以使用6.11.0

renyp-veteran commented 3 years ago

引入后,项目启动报错是怎么回事

------------------ 原始邮件 ------------------ 发件人: "Nepxion/Discovery" @.>; 发送时间: 2021年7月21日(星期三) 晚上6:44 @.>; @.**@.>; 主题: Re: [Nepxion/Discovery] spring cloud 引入问题 (#169)

F,G,H都可以使用6.11.0

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe.

renyp-veteran commented 3 years ago

我的pom文件

<?xml version="1.0" encoding="UTF-8"?> <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"&gt; <modelVersion>4.0.0</modelVersion>

<artifactId>kcwl-app-gateway</artifactId> <packaging>jar</packaging>

<parent> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-parent</artifactId> <version>2.1.10.RELEASE</version> </parent>

<name>kcwl-app-gateway</name> <properties> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding> <java.version>1.8</java.version> <spring-cloud.version>Greenwich.SR5</spring-cloud.version> <lombok.version>1.18.6</lombok.version> <kcwl-framework.version>1.1.6-SNAPSHOT</kcwl-framework.version> <spring.cloud.openfeign.version>2.2.5.RELEASE</spring.cloud.openfeign.version>

  <discovery.version&gt;6.10.0</discovery.version&gt;

  <!-- Spring Cloud Hoxton compatible versions --&gt;