|
@@ -100,6 +100,11 @@ public class ConsulHelper {
|
|
|
String hosts = consulProperties.getHost();
|
|
String hosts = consulProperties.getHost();
|
|
|
Assert.hasText(hosts, "注册不能为空");
|
|
Assert.hasText(hosts, "注册不能为空");
|
|
|
if (hosts.indexOf(",") == -1) {
|
|
if (hosts.indexOf(",") == -1) {
|
|
|
|
|
+ String host = consulProperties.getHost();
|
|
|
|
|
+ if (host.indexOf(":") > -1) {
|
|
|
|
|
+ String[] items = host.split(":");
|
|
|
|
|
+ return HostItem.builder().host(items[0]).port(Integer.parseInt(items[1])).build();
|
|
|
|
|
+ }
|
|
|
return HostItem.builder().host(hosts).build();
|
|
return HostItem.builder().host(hosts).build();
|
|
|
}
|
|
}
|
|
|
final Set<HostItem> hostItems = hostItems(consulProperties);
|
|
final Set<HostItem> hostItems = hostItems(consulProperties);
|