apache / apache/dubbo

dubbo3 使用nacos作为配置中心, 获取不到配置项

Open
#11,200 5 comments 0 reactions 0 assignees View on GitHub
type/discussion
Dominant language
Java
Stars
41.6k
Forks
26.4k
Avg merge
15h 13m
Merged PRs (30d)
4

Description

一: 环境: springboot版本dubbo 3.1.3 / naocs 2.0.3

二: maven依赖如下:
```

org.apache.dubbo
dubbo-spring-boot-starter
3.1.3


org.apache.dubbo
dubbo-configcenter-nacos
3.1.3


com.alibaba.nacos
nacos-client
2.0.3

```

三: 项目启动的配置文件:
```
dubbo:
config-center:
address: nacos://127.0.0.1:8848
group: dubbo
namespace: 4fc48c00-e259-4051-99cc-fa20642b2eff
config-file: dubbo.yaml
```

四: nacos截图

![image](https://user-images.githubusercontent.com/35493712/209420451-fa0c15c3-4622-4783-8c58-3da5257604eb.png)

五: 问题:
1. 无法读取yaml文件, 启动会报错 ava.lang.IllegalStateException: No such any registry to reference com.tawa.product.client.InventoryClient on the consumer 192.168.137.1 use dubbo version 3.1.3, please config to your spring config.
(如果是properties格式, 能正常启动, 但是会有问题2)

2. 在项目中, 无法读取配置文件, 比如 是无法读取的
@Value("${dubbo.registry.address}")
private String config;

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.