集成Nacos1.2.1和Dubbo2.7.6 消费者报错No provider available for the service xxx
程序员文章站
2022-07-15 14:28:26
...
maven依赖
<dependency>
<groupId>org.apache.dubbo</groupId>
<artifactId>dubbo-registry-nacos</artifactId>
<version>2.7.6</version>
</dependency>
<dependency>
<groupId>com.alibaba.nacos</groupId>
<artifactId>nacos-client</artifactId>
<version>1.2.1</version>
</dependency>
<dependency>
<groupId>org.apache.dubbo</groupId>
<artifactId>dubbo-spring-boot-starter</artifactId>
<version>2.7.6</version>
</dependency>
<dependency>
<groupId>org.apache.dubbo</groupId>
<artifactId>dubbo</artifactId>
<version>2.7.6</version>
</dependency>
都是用的目前最新的,Dubbo的生成者能正常的注册.但是消费者提示无法注入@Reference,原因是生产和消费者没有注明group信息
@Reference(version = "1.0.0", group = "dubbo")
@Service(version = "1.0.0", group = "dubbo")
如果没有group信息,dubbo-registry-nacos版本的bug.我们如果要使用这个版本就需要加上group.在2.7.7应该解决了这个bug
bug参考:https://github.com/apache/dubbo/issues/6077