ggbocoder commented on code in PR #6538:
URL: https://github.com/apache/incubator-seata/pull/6538#discussion_r1694276508
##########
server/src/main/java/org/apache/seata/server/Server.java:
##########
@@ -31,20 +36,71 @@
import org.apache.seata.server.lock.LockerManagerFactory;
import org.apache.seata.server.metrics.MetricsManager;
import org.apache.seata.server.session.SessionHolder;
+import org.apache.seata.server.store.StoreConfig;
+import org.apache.seata.server.store.VGroupMappingStoreManager;
import
org.springframework.beans.factory.config.ConfigurableListableBeanFactory;
import org.springframework.context.ApplicationListener;
+import org.springframework.core.env.ConfigurableEnvironment;
+import org.springframework.core.env.EnumerablePropertySource;
+import org.springframework.core.env.PropertySource;
import org.springframework.web.context.support.GenericWebApplicationContext;
import static
org.apache.seata.common.Constants.OBJECT_KEY_SPRING_APPLICATION_CONTEXT;
+import static
org.apache.seata.common.Constants.OBJECT_KEY_SPRING_CONFIGURABLE_ENVIRONMENT;
import static
org.apache.seata.spring.boot.autoconfigure.StarterConstants.REGEX_SPLIT_CHAR;
import static
org.apache.seata.spring.boot.autoconfigure.StarterConstants.REGISTRY_PREFERED_NETWORKS;
/**
* The type Server.
- *
*/
public class Server {
+
+ public static void metadataInit() {
+
+ ConfigurableEnvironment environment = (ConfigurableEnvironment)
ObjectHolder.INSTANCE.getObject(OBJECT_KEY_SPRING_CONFIGURABLE_ENVIRONMENT);
+
+ // load node properties
+ Instance instance = Instance.getInstance();
+ // load namespace
+ String namespaceKey = "seata.registry.namingserver.namespace";
Review Comment:
done
##########
server/src/main/java/org/apache/seata/server/Server.java:
##########
@@ -31,20 +36,71 @@
import org.apache.seata.server.lock.LockerManagerFactory;
import org.apache.seata.server.metrics.MetricsManager;
import org.apache.seata.server.session.SessionHolder;
+import org.apache.seata.server.store.StoreConfig;
+import org.apache.seata.server.store.VGroupMappingStoreManager;
import
org.springframework.beans.factory.config.ConfigurableListableBeanFactory;
import org.springframework.context.ApplicationListener;
+import org.springframework.core.env.ConfigurableEnvironment;
+import org.springframework.core.env.EnumerablePropertySource;
+import org.springframework.core.env.PropertySource;
import org.springframework.web.context.support.GenericWebApplicationContext;
import static
org.apache.seata.common.Constants.OBJECT_KEY_SPRING_APPLICATION_CONTEXT;
+import static
org.apache.seata.common.Constants.OBJECT_KEY_SPRING_CONFIGURABLE_ENVIRONMENT;
import static
org.apache.seata.spring.boot.autoconfigure.StarterConstants.REGEX_SPLIT_CHAR;
import static
org.apache.seata.spring.boot.autoconfigure.StarterConstants.REGISTRY_PREFERED_NETWORKS;
/**
* The type Server.
- *
*/
public class Server {
+
+ public static void metadataInit() {
+
+ ConfigurableEnvironment environment = (ConfigurableEnvironment)
ObjectHolder.INSTANCE.getObject(OBJECT_KEY_SPRING_CONFIGURABLE_ENVIRONMENT);
+
+ // load node properties
+ Instance instance = Instance.getInstance();
+ // load namespace
+ String namespaceKey = "seata.registry.namingserver.namespace";
+ String namespace = environment.getProperty(namespaceKey, "public");
+ instance.setNamespace(namespace);
+ // load cluster name
+ String clusterNameKey = "seata.registry.namingserver.cluster";
Review Comment:
done
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]