You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@seata.apache.org by "funky-eyes (via GitHub)" <gi...@apache.org> on 2024/09/08 06:11:41 UTC

Re: [PR] spring boot compatible with file.conf and registry.conf (#6811) [incubator-seata]

funky-eyes commented on code in PR #6828:
URL: https://github.com/apache/incubator-seata/pull/6828#discussion_r1749095308


##########
seata-spring-autoconfigure/seata-spring-autoconfigure-core/src/main/java/org/apache/seata/spring/boot/autoconfigure/provider/SeataFileConfigurationProvider.java:
##########
@@ -0,0 +1,83 @@
+package org.apache.seata.spring.boot.autoconfigure.provider;
+
+import java.util.Arrays;
+import java.util.List;
+import java.util.Map;
+import java.util.Optional;
+import java.util.Properties;
+
+import org.apache.commons.lang.StringUtils;
+import org.apache.seata.common.util.CollectionUtils;
+import org.apache.seata.config.FileConfiguration;
+import org.apache.seata.config.ConfigurationFactory;
+import org.apache.seata.config.file.FileConfig;
+import org.springframework.context.ApplicationContext;
+import org.springframework.context.ApplicationContextAware;
+import org.springframework.context.ApplicationListener;
+import org.springframework.context.event.ContextRefreshedEvent;
+import org.springframework.core.env.ConfigurableEnvironment;
+import org.springframework.core.env.PropertiesPropertySource;
+
+import static org.apache.seata.common.ConfigurationKeys.FILE_ROOT_PREFIX_CONFIG;
+import static org.apache.seata.common.ConfigurationKeys.FILE_ROOT_PREFIX_REGISTRY;
+import static org.apache.seata.common.ConfigurationKeys.SERVER_PREFIX;
+import static org.apache.seata.common.ConfigurationKeys.STORE_PREFIX;
+import static org.apache.seata.common.ConfigurationKeys.METRICS_PREFIX;
+import static org.apache.seata.common.ConfigurationKeys.TRANSPORT_PREFIX;
+import static org.apache.seata.common.ConfigurationKeys.SEATA_FILE_PREFIX_ROOT_CONFIG;
+
+public class SeataFileConfigurationProvider implements ApplicationContextAware, ApplicationListener<ContextRefreshedEvent> {

Review Comment:
   我认为你应该将SeataPropertiesLoader改为给client和server共同使用的方式,而不是重复写一些逻辑
   I think you should change the SeataPropertiesLoader to a common way for client and server, rather than rewriting some logic



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@seata.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@seata.apache.org
For additional commands, e-mail: notifications-help@seata.apache.org