in discovery/seata-discovery-sofa/src/main/java/org/apache/seata/discovery/registry/sofa/SofaRegistryServiceImpl.java [211:272]
private static Properties getNamingProperties() {
Properties properties = new Properties();
if (System.getProperty(SOFA_FILEKEY_PREFIX + PRO_SERVER_ADDR_KEY) != null) {
properties.setProperty(PRO_SERVER_ADDR_KEY, System.getProperty(SOFA_FILEKEY_PREFIX + PRO_SERVER_ADDR_KEY));
} else {
String address = FILE_CONFIG.getConfig(getSofaAddrFileKey());
if (address != null) {
properties.setProperty(PRO_SERVER_ADDR_KEY, address);
}
}
if (System.getProperty(SOFA_FILEKEY_PREFIX + PRO_REGION_KEY) != null) {
properties.setProperty(PRO_REGION_KEY, System.getProperty(SOFA_FILEKEY_PREFIX + PRO_REGION_KEY));
} else {
String region = FILE_CONFIG.getConfig(getSofaRegionFileKey());
if (region == null) {
region = DEFAULT_LOCAL_REGION;
}
properties.setProperty(PRO_REGION_KEY, region);
}
if (System.getProperty(SOFA_FILEKEY_PREFIX + PRO_DATACENTER_KEY) != null) {
properties.setProperty(PRO_DATACENTER_KEY, System.getProperty(SOFA_FILEKEY_PREFIX + PRO_DATACENTER_KEY));
} else {
String datacenter = FILE_CONFIG.getConfig(getSofaDataCenterFileKey());
if (datacenter == null) {
datacenter = DEFAULT_LOCAL_DATACENTER;
}
properties.setProperty(PRO_DATACENTER_KEY, datacenter);
}
if (System.getProperty(SOFA_FILEKEY_PREFIX + PRO_GROUP_KEY) != null) {
properties.setProperty(PRO_GROUP_KEY, System.getProperty(SOFA_FILEKEY_PREFIX + PRO_GROUP_KEY));
} else {
String group = FILE_CONFIG.getConfig(getSofaGroupFileKey());
if (group == null) {
group = DEFAULT_GROUP;
}
properties.setProperty(PRO_GROUP_KEY, group);
}
if (System.getProperty(SOFA_FILEKEY_PREFIX + PRO_CLUSTER_KEY) != null) {
properties.setProperty(PRO_CLUSTER_KEY, System.getProperty(SOFA_FILEKEY_PREFIX + PRO_CLUSTER_KEY));
} else {
String cluster = FILE_CONFIG.getConfig(getSofaClusterFileKey());
if (cluster == null) {
cluster = DEFAULT_CLUSTER;
}
properties.setProperty(PRO_CLUSTER_KEY, cluster);
}
if (System.getProperty(SOFA_FILEKEY_PREFIX + PRO_ADDRESS_WAIT_TIME_KEY) != null) {
properties.setProperty(PRO_ADDRESS_WAIT_TIME_KEY, System.getProperty(SOFA_FILEKEY_PREFIX + PRO_ADDRESS_WAIT_TIME_KEY));
} else {
String group = FILE_CONFIG.getConfig(getSofaAddressWaitTimeFileKey());
if (group == null) {
group = DEFAULT_ADDRESS_WAIT_TIME;
}
properties.setProperty(PRO_ADDRESS_WAIT_TIME_KEY, group);
}
return properties;
}