compilable with other dependencies, 1.0.1.BUILD-SNAPSHOT
This commit is contained in:
22
pom.xml
22
pom.xml
@@ -14,7 +14,7 @@
|
||||
<parent>
|
||||
<groupId>org.springframework.cloud</groupId>
|
||||
<artifactId>spring-cloud-build</artifactId>
|
||||
<version>1.0.0.BUILD-SNAPSHOT</version>
|
||||
<version>1.0.1.BUILD-SNAPSHOT</version>
|
||||
<relativePath/>
|
||||
<!-- lookup parent from repository -->
|
||||
</parent>
|
||||
@@ -57,32 +57,32 @@
|
||||
<dependency>
|
||||
<groupId>org.springframework.cloud</groupId>
|
||||
<artifactId>spring-cloud-zookeeper-core</artifactId>
|
||||
<version>1.0.0.BUILD-SNAPSHOT</version>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.cloud</groupId>
|
||||
<artifactId>spring-cloud-zookeeper-bus</artifactId>
|
||||
<version>1.0.0.BUILD-SNAPSHOT</version>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.cloud</groupId>
|
||||
<artifactId>spring-cloud-zookeeper-config</artifactId>
|
||||
<version>1.0.0.BUILD-SNAPSHOT</version>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.cloud</groupId>
|
||||
<artifactId>spring-cloud-zookeeper-discovery</artifactId>
|
||||
<version>1.0.0.BUILD-SNAPSHOT</version>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.cloud</groupId>
|
||||
<artifactId>spring-cloud-commons</artifactId>
|
||||
<version>1.0.0.BUILD-SNAPSHOT</version>
|
||||
<version>${spring.cloud.commons}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.cloud</groupId>
|
||||
<artifactId>spring-cloud-bus</artifactId>
|
||||
<version>1.0.0.BUILD-SNAPSHOT</version>
|
||||
<version>${spring.cloud.bus}</version>
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
@@ -112,12 +112,12 @@
|
||||
<dependency>
|
||||
<groupId>org.springframework.cloud</groupId>
|
||||
<artifactId>spring-cloud-config-client</artifactId>
|
||||
<version>1.0.0.BUILD-SNAPSHOT</version>
|
||||
<version>${spring.cloud.config.client}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.cloud</groupId>
|
||||
<artifactId>spring-cloud-netflix-core</artifactId>
|
||||
<version>1.0.0.BUILD-SNAPSHOT</version>
|
||||
<version>${spring.cloud.netflix.core}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.curator</groupId>
|
||||
@@ -165,6 +165,10 @@
|
||||
</dependencyManagement>
|
||||
|
||||
<properties>
|
||||
<spring.cloud.commons>1.0.1.BUILD-SNAPSHOT</spring.cloud.commons>
|
||||
<spring.cloud.bus>1.0.1.BUILD-SNAPSHOT</spring.cloud.bus>
|
||||
<spring.cloud.config.client>1.0.1.BUILD-SNAPSHOT</spring.cloud.config.client>
|
||||
<spring.cloud.netflix.core>1.0.1.BUILD-SNAPSHOT</spring.cloud.netflix.core>
|
||||
<curator.version>2.7.0</curator.version>
|
||||
<ribbon.version>2.0-RC9</ribbon.version>
|
||||
</properties>
|
||||
|
||||
@@ -8,7 +8,8 @@ import javax.annotation.PreDestroy;
|
||||
|
||||
import org.apache.curator.framework.CuratorFramework;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.cloud.config.client.PropertySourceLocator;
|
||||
// import org.springframework.cloud.config.client.PropertySourceLocator;
|
||||
import org.springframework.cloud.bootstrap.config.PropertySourceLocator;
|
||||
import org.springframework.core.env.CompositePropertySource;
|
||||
import org.springframework.core.env.ConfigurableEnvironment;
|
||||
import org.springframework.core.env.Environment;
|
||||
|
||||
@@ -41,7 +41,7 @@ public class ZookeeperDiscoveryClient implements DiscoveryClient {
|
||||
+ context.getId());
|
||||
}
|
||||
return new DefaultServiceInstance(instance.getId(), instance.getAddress(),
|
||||
instance.getPort());
|
||||
instance.getPort(), instance.getSslPort()!=null);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -55,26 +55,26 @@ public class ZookeeperDiscoveryClient implements DiscoveryClient {
|
||||
|
||||
for (ServiceInstance<ZookeeperInstance> instance : zkInstances) {
|
||||
instances.add(new DefaultServiceInstance(serviceId, instance.getAddress(),
|
||||
instance.getPort()));
|
||||
instance.getPort(), instance.getSslPort()!=null));
|
||||
}
|
||||
|
||||
return instances;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SneakyThrows
|
||||
public List<org.springframework.cloud.client.ServiceInstance> getAllInstances() {
|
||||
List<org.springframework.cloud.client.ServiceInstance> instances = new ArrayList<>();
|
||||
|
||||
for (String name : discovery.queryForNames()) {
|
||||
for (ServiceInstance<ZookeeperInstance> instance: discovery.queryForInstances(name)) {
|
||||
instances.add(new DefaultServiceInstance(instance.getName(), instance
|
||||
.getAddress(), instance.getPort()));
|
||||
}
|
||||
}
|
||||
|
||||
return instances;
|
||||
}
|
||||
// @Override
|
||||
// @SneakyThrows
|
||||
// public List<org.springframework.cloud.client.ServiceInstance> getAllInstances() {
|
||||
// List<org.springframework.cloud.client.ServiceInstance> instances = new ArrayList<>();
|
||||
//
|
||||
// for (String name : discovery.queryForNames()) {
|
||||
// for (ServiceInstance<ZookeeperInstance> instance: discovery.queryForInstances(name)) {
|
||||
// instances.add(new DefaultServiceInstance(instance.getName(), instance
|
||||
// .getAddress(), instance.getPort(), instance.getSslPort()!=null));
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// return instances;
|
||||
// }
|
||||
|
||||
@Override
|
||||
public List<String> getServices() {
|
||||
|
||||
Reference in New Issue
Block a user