1
0
mirror of https://gitee.com/mirrors/Spring-Cloud-Alibaba.git synced 2021-06-26 13:25:11 +08:00

update nacos version to 0.2.1-RC and format code

This commit is contained in:
flystar32
2018-09-20 11:32:30 +08:00
parent e2b73fc3f0
commit 16d2c1b903
8 changed files with 18 additions and 15 deletions

View File

@@ -16,7 +16,6 @@
package org.springframework.cloud.alibaba.nacos.client;
import java.util.Properties;
import org.slf4j.Logger;
@@ -81,13 +80,14 @@ public class NacosPropertySourceLocator implements PropertySourceLocator {
Properties properties = getPropertiesFromEnv(env);
try {
configService = NacosFactory.createConfigService(properties);
configService = NacosFactory.createConfigService(properties);
}
catch (NacosException e) {
logger.error("create config service error, nacosConfigProperties:{}, ", properties, e);
logger.error("create config service error, nacosConfigProperties:{}, ",
properties, e);
return null;
}
beanFactory.registerSingleton("configService", configService);
if (null == configService) {
@@ -96,7 +96,8 @@ public class NacosPropertySourceLocator implements PropertySourceLocator {
return null;
}
long timeout = nacosConfigProperties.getTimeout();
nacosPropertySourceBuilder = new NacosPropertySourceBuilder(configService, timeout);
nacosPropertySourceBuilder = new NacosPropertySourceBuilder(configService,
timeout);
String applicationName = env.getProperty("spring.application.name");
logger.info("Initialize spring.application.name '" + applicationName + "'.");
@@ -112,7 +113,8 @@ public class NacosPropertySourceLocator implements PropertySourceLocator {
CompositePropertySource composite = new CompositePropertySource(
NACOS_PROPERTY_SOURCE_NAME);
loadApplicationConfiguration(composite, env, nacosGroup, dataIdPrefix, contentType);
loadApplicationConfiguration(composite, env, nacosGroup, dataIdPrefix,
contentType);
return composite;
}
@@ -131,8 +133,9 @@ public class NacosPropertySourceLocator implements PropertySourceLocator {
}
private void loadNacosDataIfPresent(final CompositePropertySource composite,
final String dataId, final String group,String contentType) {
NacosPropertySource ps = nacosPropertySourceBuilder.build(dataId, group, contentType);
final String dataId, final String group, String contentType) {
NacosPropertySource ps = nacosPropertySourceBuilder.build(dataId, group,
contentType);
if (ps != null) {
composite.addFirstPropertySource(ps);
}

View File

@@ -4,4 +4,4 @@ org.springframework.boot.autoconfigure.EnableAutoConfiguration=\
org.springframework.cloud.alibaba.nacos.NacosConfigAutoConfiguration,\
org.springframework.cloud.alibaba.nacos.endpoint.NacosConfigEndpointAutoConfiguration
org.springframework.boot.diagnostics.FailureAnalyzer=\
org.springframework.cloud.alibaba.nacos..analyzer.NacosConnectionFailureAnalyzerdiagnostics
org.springframework.cloud.alibaba.nacos.diagnostics.analyzer.NacosConnectionFailureAnalyzer