Merge pull request #3601 from chickenlj/2.2.x-backport-3508

Fix #3314, set default nacos server address when spring.config.import enabled.
pull/3616/head
RuanSheng 1 year ago committed by GitHub
commit 15ecd86dfb
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -89,6 +89,11 @@ public class NacosConfigProperties {
*/
public static final String DEFAULT_NAMESPACE = "public";
/**
* Nacos default server and port.
*/
public static final String DEFAULT_ADDRESS = "127.0.0.1:8848";
private static final Pattern PATTERN = Pattern.compile("-(\\w)");
private static final Logger log = LoggerFactory
@ -561,7 +566,7 @@ public class NacosConfigProperties {
*/
public Properties assembleConfigServiceProperties() {
Properties properties = new Properties();
properties.put(SERVER_ADDR, Objects.toString(this.serverAddr, ""));
properties.put(SERVER_ADDR, Objects.toString(this.serverAddr, DEFAULT_ADDRESS));
properties.put(USERNAME, Objects.toString(this.username, ""));
properties.put(PASSWORD, Objects.toString(this.password, ""));
properties.put(ENCODE, Objects.toString(this.encode, ""));

Loading…
Cancel
Save