Merge branch '2.2.x'
This commit is contained in:
@@ -277,6 +277,18 @@ implementations provided by Spring Cloud, among others `ConsulDiscoveryClient`,
|
||||
`ZookeeperDiscoveryClient`. In order to do it, you just need to set the
|
||||
`spring.cloud.{clientIdentifier}.discovery.order` (or `eureka.client.order` for Eureka) property to the desired value.
|
||||
|
||||
==== SimpleDiscoveryClient
|
||||
|
||||
If there is no Service-Registry-backed `DiscoveryClient` in the classpath, `SimpleDiscoveryClient`
|
||||
instance, that uses properties to get information on service and instances, will be used.
|
||||
|
||||
The information about the available instances should be passed to via properties in the following format:
|
||||
`spring.cloud.discovery.client.simple.instances.service1[0].uri=http://s11:8080`, where
|
||||
`spring.cloud.discovery.client.simple.instances` is the common prefix, then `service1` stands
|
||||
for the ID of the service in question, while `[0]` indicates the index number of the instance
|
||||
(as visible in the example, indexes start with `0`), and then the value of `uri` is
|
||||
the actual URI under which the instance is available.
|
||||
|
||||
=== ServiceRegistry
|
||||
|
||||
Commons now provides a `ServiceRegistry` interface that provides methods such as `register(Registration)` and `deregister(Registration)`, which let you provide custom registered services.
|
||||
|
||||
@@ -30,7 +30,6 @@ import org.springframework.cloud.commons.util.InetUtils;
|
||||
import org.springframework.context.ApplicationListener;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.core.Ordered;
|
||||
import org.springframework.core.annotation.Order;
|
||||
|
||||
/**
|
||||
@@ -68,7 +67,7 @@ public class SimpleDiscoveryClientAutoConfiguration
|
||||
}
|
||||
|
||||
@Bean
|
||||
@Order(Ordered.LOWEST_PRECEDENCE)
|
||||
@Order
|
||||
public DiscoveryClient simpleDiscoveryClient() {
|
||||
return new SimpleDiscoveryClient(simpleDiscoveryProperties());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user