public NacosDataSource getObject()

in spring-cloud-alibaba-starters/spring-cloud-alibaba-sentinel-datasource/src/main/java/com/alibaba/cloud/sentinel/datasource/factorybean/NacosDataSourceFactoryBean.java [59:87]


	public NacosDataSource getObject() throws Exception {
		Properties properties = new Properties();
		if (!StringUtils.isEmpty(this.serverAddr)) {
			properties.setProperty(PropertyKeyConst.SERVER_ADDR, this.serverAddr);
		}
		else {
			properties.setProperty(PropertyKeyConst.ENDPOINT, this.endpoint);
		}

		if (!StringUtils.isEmpty(this.contextPath)) {
			properties.setProperty(PropertyKeyConst.CONTEXT_PATH, this.contextPath);
		}
		if (!StringUtils.isEmpty(this.accessKey)) {
			properties.setProperty(PropertyKeyConst.ACCESS_KEY, this.accessKey);
		}
		if (!StringUtils.isEmpty(this.secretKey)) {
			properties.setProperty(PropertyKeyConst.SECRET_KEY, this.secretKey);
		}
		if (!StringUtils.isEmpty(this.namespace)) {
			properties.setProperty(PropertyKeyConst.NAMESPACE, this.namespace);
		}
		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);
	}