Skip to content

Commit 070e0a8

Browse files
Add info on SimpleDiscoveryClient in the docs. Remove redundant param. (#684)
* Add info on SimpleDiscoveryClient in the docs. Remove redundant parameter. * Remove warning after discussion.
1 parent 22efb79 commit 070e0a8

File tree

2 files changed

+13
-2
lines changed

2 files changed

+13
-2
lines changed

docs/src/main/asciidoc/spring-cloud-commons.adoc

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -277,6 +277,18 @@ implementations provided by Spring Cloud, among others `ConsulDiscoveryClient`,
277277
`ZookeeperDiscoveryClient`. In order to do it, you just need to set the
278278
`spring.cloud.{clientIdentifier}.discovery.order` (or `eureka.client.order` for Eureka) property to the desired value.
279279

280+
==== SimpleDiscoveryClient
281+
282+
If there is no Service-Registry-backed `DiscoveryClient` in the classpath, `SimpleDiscoveryClient`
283+
instance, that uses properties to get information on service and instances, will be used.
284+
285+
The information about the available instances should be passed to via properties in the following format:
286+
`spring.cloud.discovery.client.simple.instances.service1[0].uri=http://s11:8080`, where
287+
`spring.cloud.discovery.client.simple.instances` is the common prefix, then `service1` stands
288+
for the ID of the service in question, while `[0]` indicates the index number of the instance
289+
(as visible in the example, indexes start with `0`), and then the value of `uri` is
290+
the actual URI under which the instance is available.
291+
280292
=== ServiceRegistry
281293

282294
Commons now provides a `ServiceRegistry` interface that provides methods such as `register(Registration)` and `deregister(Registration)`, which let you provide custom registered services.

spring-cloud-commons/src/main/java/org/springframework/cloud/client/discovery/simple/SimpleDiscoveryClientAutoConfiguration.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@
3030
import org.springframework.context.ApplicationListener;
3131
import org.springframework.context.annotation.Bean;
3232
import org.springframework.context.annotation.Configuration;
33-
import org.springframework.core.Ordered;
3433
import org.springframework.core.annotation.Order;
3534

3635
/**
@@ -68,7 +67,7 @@ public SimpleDiscoveryProperties simpleDiscoveryProperties() {
6867
}
6968

7069
@Bean
71-
@Order(Ordered.LOWEST_PRECEDENCE)
70+
@Order
7271
public DiscoveryClient simpleDiscoveryClient() {
7372
return new SimpleDiscoveryClient(simpleDiscoveryProperties());
7473
}

0 commit comments

Comments
 (0)