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

feature:Support to obtain multiple configurations through a single dataid in Nacos #3303

Merged
merged 24 commits into from Dec 25, 2020

Conversation

Rubbernecker
Copy link
Contributor

@Rubbernecker Rubbernecker commented Nov 24, 2020

Ⅰ. 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

image

registry.conf

image

nacos中的属性配置如下:
image

Ⅴ. Special notes for reviews

将config.type设置为“nacos”。
此功能已实现动态配置,同时兼容旧的配置方式。
seata-server也可以通过这种方式配置。

@Rubbernecker
Copy link
Contributor Author

a364176773 nacos配置中心的功能已经改好了,之前那个没有实现动态配置,这次加上了,你们看一下。

@codecov-io
Copy link

codecov-io commented Nov 24, 2020

Codecov Report

Merging #3303 (134feb0) into develop (23a407e) will increase coverage by 0.45%.
The diff coverage is 50.84%.

Impacted file tree graph

@@              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     
Impacted Files Coverage Δ Complexity Δ
...n/src/main/java/io/seata/common/DefaultValues.java 0.00% <ø> (ø) 0.00 <0.00> (ø)
...ava/io/seata/core/constants/ConfigurationKeys.java 0.00% <ø> (ø) 0.00 <0.00> (ø)
...c/main/java/io/seata/core/context/RootContext.java 47.16% <0.00%> (-3.78%) 18.00 <0.00> (-1.00)
...ava/io/seata/core/rpc/netty/NettyServerConfig.java 0.00% <0.00%> (ø) 0.00 <0.00> (ø)
...io/seata/core/rpc/netty/RmNettyRemotingClient.java 39.13% <ø> (ø) 10.00 <0.00> (ø)
...ata/core/rpc/processor/server/BatchLogHandler.java 0.00% <ø> (ø) 0.00 <0.00> (ø)
...scovery/loadbalance/ConsistentHashLoadBalance.java 89.28% <ø> (ø) 3.00 <0.00> (ø)
.../discovery/loadbalance/LeastActiveLoadBalance.java 100.00% <ø> (ø) 7.00 <0.00> (ø)
...eata/discovery/loadbalance/LoadBalanceFactory.java 50.00% <ø> (ø) 1.00 <0.00> (ø)
...seata/discovery/loadbalance/RandomLoadBalance.java 100.00% <ø> (ø) 2.00 <0.00> (ø)
... and 62 more

@funky-eyes funky-eyes added this to the 1.5.0 milestone Dec 10, 2020
@funky-eyes funky-eyes added module/config config module first-time contributor first-time contributor labels Dec 10, 2020
Copy link
Contributor

@funky-eyes funky-eyes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Contributor

@l81893521 l81893521 left a 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";
Copy link
Contributor

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

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

默认值都是seata.properties

Copy link
Contributor

@l81893521 l81893521 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@l81893521 l81893521 merged commit 96016f0 into apache:develop Dec 25, 2020
@KYV365
Copy link

KYV365 commented May 19, 2022

seataServer.properties can be replaced by seataServer.yaml ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
first-time contributor first-time contributor module/config config module
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants