当前位置:网站首页>Nacos Basics (5): getting started with Nacos configuration
Nacos Basics (5): getting started with Nacos configuration
2022-04-23 11:26:00 【There is no retreat when sailing against the current】
Preface
How to publish configurations ?nacos How the client gets the configuration ?
Section 1 Release configuration
- open nacos Console , Click on Configuration Management >> Configuration list , Click on + No. add configuration

- Fill in the configuration information , And publish , View the configuration list , The configuration content just appears .


In the second quarter nacos Client get configuration
-
newly build maven project
-
Introduce dependencies
<dependency>
<groupId>com.alibaba.nacos</groupId>
<artifactId>nacos-client</artifactId>
<version>1.3.2</version>
</dependency>
- To write java Code
package com.it2;
import com.alibaba.nacos.api.NacosFactory;
import com.alibaba.nacos.api.config.ConfigService;
import com.alibaba.nacos.api.exception.NacosException;
import java.util.Properties;
public class NacosDemo01 {
public static void main(String[] args) throws NacosException {
String dataId="nacos-demo.yaml";
String group="DEFAULT_GROUP";
String serverAddr="127.0.0.1:8848";
Properties properties=new Properties();
properties.put("serverAddr",serverAddr);
ConfigService configService= NacosFactory.createConfigService(properties);
String config=configService.getConfig(dataId,group,3000);
System.out.println(config);
}
}
- Run code , Then we can see the front nacos The content just configured in .

版权声明
本文为[There is no retreat when sailing against the current]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/04/202204231117595202.html
边栏推荐
- Upgrade the functions available for cpolar intranet penetration
- When the activity is in progress! Click the link to join the live studio to participate in "can AI really save energy?" Let's have a discussion!
- Study notes of C [8] SQL [1]
- Simple construction of rebbitmq
- 讯飞2021年营收183亿:同比增41% 净利为15.56亿
- Usage Summary of datetime and timestamp in MySQL
- Write console script by laravel
- MySQL failed to insert the datetime type field without single quotation marks
- [Web 每日一练] 八色拼图(float)
- QT信号量 无法解析的错误的总结
猜你喜欢
随机推荐
Usage of rename in cygwin
Use of SVN:
My creation anniversary
[Web 每日一练] 八色拼图(float)
GPU, CUDA,cuDNN三者的关系总结
Exploring the equipment and teaching of robot education
MySQL数据库10秒内插入百万条数据的实现
Redis optimization series (II) redis master-slave principle and master-slave common configuration
Simple construction of rebbitmq
Résumé de la relation entre GPU, cuda et cudnn
得物技术网络优化-CDN资源请求优化实践
项目实训-火爆辣椒
Learn go language 0x07: stringer exercise code in go language journey
Mysql中有关Datetime和Timestamp的使用总结
赛微微电科创板上市破发:跌幅达26% 公司市值44亿
Understanding of MQ
创客教育中的统筹方案管理模式
学习 Go 语言 0x03:理解变量之间的依赖以及初始化顺序
On lambda powertools typescript
Detailed explanation of MySQL creation stored procedure and function








