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

Merge pull request #1354 from yuhuangbin/sentinel-nacos

Sentinel Nacos Data Source Certification
This commit is contained in:
Mercy Ma
2020-05-08 16:16:22 +08:00
committed by GitHub
4 changed files with 58 additions and 4 deletions

View File

@@ -32,6 +32,10 @@ public class NacosDataSourceProperties extends AbstractDataSourceProperties {
private String serverAddr;
private String username;
private String password;
@NotEmpty
private String groupId = "DEFAULT_GROUP";
@@ -67,6 +71,22 @@ public class NacosDataSourceProperties extends AbstractDataSourceProperties {
this.serverAddr = serverAddr;
}
public String getUsername() {
return username;
}
public void setUsername(String username) {
this.username = username;
}
public String getPassword() {
return password;
}
public void setPassword(String password) {
this.password = password;
}
public String getGroupId() {
return groupId;
}

View File

@@ -35,6 +35,10 @@ public class NacosDataSourceFactoryBean implements FactoryBean<NacosDataSource>
private String serverAddr;
private String username;
private String password;
private String groupId;
private String dataId;
@@ -63,6 +67,8 @@ public class NacosDataSourceFactoryBean implements FactoryBean<NacosDataSource>
if (!StringUtils.isEmpty(this.namespace)) {
properties.setProperty(PropertyKeyConst.NAMESPACE, this.namespace);
}
properties.setProperty(PropertyKeyConst.USERNAME, this.username);
properties.setProperty(PropertyKeyConst.PASSWORD, this.password);
return new NacosDataSource(properties, groupId, dataId, converter);
}
@@ -79,6 +85,22 @@ public class NacosDataSourceFactoryBean implements FactoryBean<NacosDataSource>
this.serverAddr = serverAddr;
}
public String getUsername() {
return username;
}
public void setUsername(String username) {
this.username = username;
}
public String getPassword() {
return password;
}
public void setPassword(String password) {
this.password = password;
}
public String getGroupId() {
return groupId;
}