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

optimize: support to obtain multiple configurations through a single key in Consul #3311

Merged
merged 30 commits into from
Sep 6, 2021

Conversation

Rubbernecker
Copy link
Contributor

Ⅰ. Describe what this PR did

添加从consul单一key获取多条配置功能,registry.conf文件添加config.consul.key属性用于指定consul中的key。

Ⅱ. 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设置为“consul”,添加config.consul.key属性,属性值为consul中的key,例如“seata.properties”,启动seata应用(server或client都可以),会自动拉取consul上“seata.properties”中的配置。

应用中的配置如下,根据项目选择对应的配置方式:

application.yml

image

registry.conf

image

consul中的属性配置如下:
image

Ⅴ. Special notes for reviews

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

@Rubbernecker
Copy link
Contributor Author

@a364176773 consul配置中心适配好了

@funky-eyes funky-eyes added this to the 1.5.0 milestone Dec 10, 2020
@funky-eyes funky-eyes added the module/config config module label Dec 10, 2020
@codecov-io
Copy link

codecov-io commented Dec 25, 2020

Codecov Report

Merging #3311 (324dd15) into develop (108e83c) will decrease coverage by 0.01%.
The diff coverage is 25.00%.

Impacted file tree graph

@@              Coverage Diff              @@
##             develop    #3311      +/-   ##
=============================================
- Coverage      51.56%   51.55%   -0.02%     
+ Complexity      3373     3372       -1     
=============================================
  Files            617      617              
  Lines          20438    20442       +4     
  Branches        2565     2565              
=============================================
  Hits           10538    10538              
- Misses          8839     8842       +3     
- Partials        1061     1062       +1     
Impacted Files Coverage Δ Complexity Δ
...gure/properties/config/ConfigConsulProperties.java 44.44% <25.00%> (-15.56%) 2.00 <0.00> (ø)
...n/src/main/java/io/seata/common/util/IdWorker.java 77.08% <0.00%> (-6.25%) 11.00% <0.00%> (-1.00%)
...c/main/java/io/seata/config/FileConfiguration.java 44.25% <0.00%> (+1.14%) 12.00% <0.00%> (ø%)

…nfig

� Conflicts:
�	changes/1.5.0.md
�	script/server/config/registry.yml
@xingfudeshi xingfudeshi self-requested a review March 15, 2021 01:43
@xingfudeshi
Copy link
Member

@Rubbernecker Pls resolve conflicts.

changes/1.5.0.md Outdated Show resolved Hide resolved
qiancheng added 3 commits June 30, 2021 12:12
…nfig

� Conflicts:
�	changes/1.5.0.md
�	changes/en-us/1.5.0.md
�	config/seata-config-consul/src/main/java/io/seata/config/consul/ConsulConfiguration.java
�	script/client/conf/registry.conf
�	script/server/config/registry.conf
�	script/server/config/registry.properties
�	script/server/config/registry.yml
�	seata-spring-autoconfigure/seata-spring-autoconfigure-core/src/main/java/io/seata/spring/boot/autoconfigure/properties/config/ConfigConsulProperties.java
�	server/src/main/resources/registry.conf
@codecov-commenter
Copy link

codecov-commenter commented Jun 30, 2021

Codecov Report

Merging #3311 (ec63ccb) into develop (772f748) will decrease coverage by 0.00%.
The diff coverage is 25.00%.

Impacted file tree graph

@@              Coverage Diff              @@
##             develop    #3311      +/-   ##
=============================================
- Coverage      40.21%   40.21%   -0.01%     
+ Complexity      3083     3081       -2     
=============================================
  Files            690      690              
  Lines          23365    23369       +4     
  Branches        2893     2894       +1     
=============================================
+ Hits            9396     9397       +1     
- Misses         13095    13098       +3     
  Partials         874      874              
Impacted Files Coverage Δ
...gure/properties/config/ConfigConsulProperties.java 38.46% <25.00%> (-5.99%) ⬇️

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

@funky-eyes
Copy link
Contributor

请解决下冲突,进行合并

@funky-eyes funky-eyes changed the title feature:Support to obtain multiple configurations through a single key in Consul optimize: support to obtain multiple configurations through a single key in Consul Sep 6, 2021
@funky-eyes funky-eyes merged commit fc327b8 into apache:develop Sep 6, 2021
UmmizzZ pushed a commit to UmmizzZ/seata that referenced this pull request Sep 30, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
module/config config module
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants