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
feature:Support to obtain multiple configurations through a single dataid in Nacos #3303
Conversation
# Conflicts: # config/seata-config-nacos/src/main/java/io/seata/config/nacos/NacosConfiguration.java
a364176773 nacos配置中心的功能已经改好了,之前那个没有实现动态配置,这次加上了,你们看一下。 |
config/seata-config-nacos/src/main/java/io/seata/config/nacos/NacosConfiguration.java
Outdated
Show resolved
Hide resolved
config/seata-config-nacos/src/main/java/io/seata/config/nacos/NacosConfiguration.java
Outdated
Show resolved
Hide resolved
config/seata-config-nacos/src/main/java/io/seata/config/nacos/NacosConfiguration.java
Outdated
Show resolved
Hide resolved
Codecov Report
@@ Coverage Diff @@
## develop #3303 +/- ##
=============================================
+ Coverage 51.11% 51.57% +0.45%
- Complexity 3297 3345 +48
=============================================
Files 614 616 +2
Lines 20125 20247 +122
Branches 2514 2540 +26
=============================================
+ Hits 10287 10442 +155
+ Misses 8806 8755 -51
- Partials 1032 1050 +18
|
...rc/main/java/io/seata/spring/boot/autoconfigure/properties/config/ConfigNacosProperties.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please record to /changes .md
@@ -31,6 +31,7 @@ | |||
private String group = "SEATA_GROUP"; | |||
private String username = ""; | |||
private String password = ""; | |||
private String dataId = "seata.properties"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you keep it same?
seata.properties
or
seataServer.properties
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
默认值都是seata.properties
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
seataServer.properties can be replaced by seataServer.yaml ? |
Ⅰ. Describe what this PR did
添加从nacos单一dataId获取多条配置功能,registry.conf文件添加config.nacos.dataId属性用于指定nacos中的dataId。
Ⅱ. Does this pull request fix one issue?
#2506 #2316
Ⅲ. Why don't you add test cases (unit test/integration test)?
此功能在原有功能上修改,不方便写测试用例。
Ⅳ. Describe how to verify it
其他功能正常配置后,在registry.conf文件中将config.type设置为“nacos”,添加config.nacos.dataId属性,属性值为nacos中的dataId,例如“seata.properties”,启动seata应用(server或client都可以),会自动拉取nacos上“seata.properties”中的配置。
应用中的配置如下,根据项目选择对应的配置方式:
application.yml
registry.conf
nacos中的属性配置如下:
Ⅴ. Special notes for reviews
将config.type设置为“nacos”。
此功能已实现动态配置,同时兼容旧的配置方式。
seata-server也可以通过这种方式配置。