mirror of
https://gitee.com/mirrors/Spring-Cloud-Alibaba.git
synced 2021-06-26 13:25:11 +08:00
Polish alibaba/spring-cloud-alibaba#1363 : Sync spring-cloud-alibaba-sentinel-datasource module
This commit is contained in:
parent
1d9c1975b2
commit
d11f2a0608
@ -17,6 +17,7 @@
|
||||
package com.alibaba.cloud.sentinel.datasource.config;
|
||||
|
||||
import com.alibaba.cloud.sentinel.datasource.factorybean.ConsulDataSourceFactoryBean;
|
||||
|
||||
import org.springframework.util.StringUtils;
|
||||
|
||||
/**
|
||||
@ -54,8 +55,7 @@ public class ConsulDataSourceProperties extends AbstractDataSourceProperties {
|
||||
@Override
|
||||
public void preCheck(String dataSourceName) {
|
||||
if (StringUtils.isEmpty(host)) {
|
||||
throw new IllegalArgumentException(
|
||||
"ConsulDataSource server-host is empty");
|
||||
throw new IllegalArgumentException("ConsulDataSource server-host is empty");
|
||||
}
|
||||
if (StringUtils.isEmpty(ruleKey)) {
|
||||
throw new IllegalArgumentException(
|
||||
|
@ -18,6 +18,7 @@ package com.alibaba.cloud.sentinel.datasource.factorybean;
|
||||
|
||||
import com.alibaba.csp.sentinel.datasource.Converter;
|
||||
import com.alibaba.csp.sentinel.datasource.consul.ConsulDataSource;
|
||||
|
||||
import org.springframework.beans.factory.FactoryBean;
|
||||
|
||||
/**
|
||||
@ -40,12 +41,7 @@ public class ConsulDataSourceFactoryBean implements FactoryBean<ConsulDataSource
|
||||
|
||||
@Override
|
||||
public ConsulDataSource getObject() throws Exception {
|
||||
return new ConsulDataSource(
|
||||
host,
|
||||
port,
|
||||
ruleKey,
|
||||
waitTimeoutInSecond,
|
||||
converter);
|
||||
return new ConsulDataSource(host, port, ruleKey, waitTimeoutInSecond, converter);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
Loading…
x
Reference in New Issue
Block a user