Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

springboot nacos 如何用@NacosConfigListener监听yml配置的变化 #189

Closed
chenjianshuo opened this issue Feb 28, 2020 · 1 comment
Closed
Assignees
Labels
enhancement New feature or request

Comments

@chenjianshuo
Copy link

chenjianshuo commented Feb 28, 2020

Describe what happened (or what feature you want)
nacos配置:

alarm:

weixin:

api: http://172.25.63.72:8080/weixin

获取动态配置如下

@(dataId = "spring-nacos-demo.yml",type = ConfigType.YAML)
public void onRecive(Properties value){
System.out.println("Properties:"+ value);
}
打印:Properties:{weixin=, api=http://172.25.63.72:8080/weix, alarm=}

@NacosConfigListener(dataId = "spring-nacos-demo.yml",type = ConfigType.YAML)
public void onRecive(String value){
System.out.println("String:"+ value);
}
打印:String:alarm:
weixin:
api: http://172.25.63.72:8080/weix

Describe what you expected to happen
如何获取:alarm.weixin.api的值呢

How to reproduce it (as minimally and precisely as possible)
Tell us your environment

com.alibaba.boot nacos-config-spring-boot-starter 0.2.4

Anything else we need to know?

@chuntaojun
Copy link
Member

This will be added in the next version and will automatically become a Map object when the parameter is Map

@chuntaojun chuntaojun self-assigned this Feb 28, 2020
@chuntaojun chuntaojun added the enhancement New feature or request label Feb 28, 2020
@chuntaojun chuntaojun mentioned this issue Mar 2, 2020
5 tasks
chuntaojun added a commit that referenced this issue Mar 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants