remove the list of serviceIds and add ServiceListInitializer

This commit is contained in:
Spencer Gibb
2014-10-02 00:42:40 -06:00
parent 2daeed6c00
commit 03e6308335
31 changed files with 113 additions and 128 deletions

View File

@@ -99,16 +99,6 @@ public class StoreIntegration {
== Declarative REST Client: Feign
Example application.yml:
```
spring:
cloud:
client:
serviceIds:
- stores
```
Example spring boot app
```
@Configuration
@@ -142,16 +132,6 @@ public interface StoreClient {
== Client Side Load Balancer: Ribbon
Example application.yml:
```
spring:
cloud:
client:
serviceIds:
- stores
```
Usage of `LoadBalancerClient` directly:
```
@@ -160,7 +140,6 @@ public class MyClass {
private LoadBalancerClient loadBalancer;
public void doStuff() {
//"stores" in choose() must match a service in spring.cloud.client.serviceIds
ServiceInstance instance = loadBalancer.choose("stores");
URI storesUri = URI.create(String.format("http://%s:%s", instance.getHost(), instance.getPort()));
// ... do something with the URI
@@ -168,7 +147,7 @@ public class MyClass {
}
```
Indirect usage via `RestTemplate`. Notice the `stores` hostname part, must match a service id in spring.cloud.client.serviceIds:
Indirect usage via `RestTemplate`.
```
public class MyClass {