alibaba / spring-cloud-alibaba

Spring Cloud Alibaba provides a one-stop solution for application development for the distributed solutions of Alibaba middleware.
https://sca.aliyun.com
Apache License 2.0
28.03k stars 8.35k forks source link

[Optimize] Optimizing autoconfiguration properties in seata #3756

Open yuluo-yx opened 6 months ago

yuluo-yx commented 6 months ago

lQLPJyEW4dOLql3NAz3NBBWwkUdzf-PIcfQGMwDXk0eSAA_1045_829

As shown in the figure, this part of the configuration is relatively redundant compared to the integration of spring cloud alibaba, we can remove these configuration items by setting the default properties to simplify the yml configuration.

uytrytryi7y7665688 commented 4 months ago

seata.config.type and seata.registry.type was put in a hashMap ,this hashmap was instance a DefaultValueFromPropertyObject

yuluo-yx commented 4 months ago

image @uytrytryi7y7665688 img upload failed.

yuluo-yx commented 4 months ago

seata.config.type and seata.registry.type was put in a hashMap ,this hashmap was instance a DefaultValueFromPropertyObject

yep, so what your means?

uytrytryi7y7665688 commented 4 months ago

If there is no system property, springboot environment, And arguments, resput are assigned and returned by the DefaultValueFromPeopleObject, which is then loaded by the EnhancedService Loader in the ConfigurationFactory and assigned to the CURRENT_Sile-INSTANCE field. Can we change its initial value from file to nacos during class loading initialization???

yuluo-yx commented 4 months ago

I don't understand what you're trying to say, the requirement of this issue is just to give the seata attribute a default value, it doesn't seem that complicated, you can see how it's implemented in other starters, and it doesn't have anything to do with nacos, it's just that the value of seata is changed to nacos in this case, and nacos is used as a registry.