sentinel NacosDataSourceFactoryBean enhance

pull/1722/head
yuhuangbin 4 years ago
parent df156d4fa2
commit 5b0d53388b

@ -67,8 +67,12 @@ 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);
if (!StringUtils.isEmpty(this.username)) {
properties.setProperty(PropertyKeyConst.USERNAME, this.username);
}
if (!StringUtils.isEmpty(this.password)) {
properties.setProperty(PropertyKeyConst.PASSWORD, this.password);
}
return new NacosDataSource(properties, groupId, dataId, converter);
}

Loading…
Cancel
Save