|
|
@ -55,17 +55,20 @@ public class MetadataContext {
|
|
|
|
private final Map<String, String> systemMetadata;
|
|
|
|
private final Map<String, String> systemMetadata;
|
|
|
|
|
|
|
|
|
|
|
|
static {
|
|
|
|
static {
|
|
|
|
String namespace = ApplicationContextAwareUtils.getProperties("spring.cloud.polaris.namespace");
|
|
|
|
String namespace = ApplicationContextAwareUtils
|
|
|
|
|
|
|
|
.getProperties("spring.cloud.polaris.namespace");
|
|
|
|
if (StringUtils.isEmpty(namespace)) {
|
|
|
|
if (StringUtils.isEmpty(namespace)) {
|
|
|
|
namespace = ApplicationContextAwareUtils.getProperties("spring.cloud.polaris.discovery.namespace", "default");
|
|
|
|
namespace = ApplicationContextAwareUtils
|
|
|
|
|
|
|
|
.getProperties("spring.cloud.polaris.discovery.namespace", "default");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
LOCAL_NAMESPACE = namespace;
|
|
|
|
LOCAL_NAMESPACE = namespace;
|
|
|
|
|
|
|
|
|
|
|
|
String serviceName = ApplicationContextAwareUtils.getProperties("spring.cloud.polaris.service");
|
|
|
|
String serviceName = ApplicationContextAwareUtils
|
|
|
|
|
|
|
|
.getProperties("spring.cloud.polaris.service");
|
|
|
|
if (StringUtils.isEmpty(serviceName)) {
|
|
|
|
if (StringUtils.isEmpty(serviceName)) {
|
|
|
|
serviceName = ApplicationContextAwareUtils.getProperties(
|
|
|
|
serviceName = ApplicationContextAwareUtils.getProperties(
|
|
|
|
"spring.cloud.polaris.discovery.service",
|
|
|
|
"spring.cloud.polaris.discovery.service", ApplicationContextAwareUtils
|
|
|
|
ApplicationContextAwareUtils.getProperties("spring.application.name", null));
|
|
|
|
.getProperties("spring.application.name", null));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
LOCAL_SERVICE = serviceName;
|
|
|
|
LOCAL_SERVICE = serviceName;
|
|
|
|
}
|
|
|
|
}
|
|
|
|