Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions docs/src/main/asciidoc/spring-cloud-commons.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@
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;

/**
Expand Down Expand Up @@ -68,7 +67,7 @@ public SimpleDiscoveryProperties simpleDiscoveryProperties() {
}

@Bean
@Order(Ordered.LOWEST_PRECEDENCE)
@Order
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why this change?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not necessary as Ordered.LOWEST_PRECEDENCE is the default value.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

so it is!

public DiscoveryClient simpleDiscoveryClient() {
return new SimpleDiscoveryClient(simpleDiscoveryProperties());
}
Expand Down