diff --git a/multi/multi_spring-cloud-consul-discovery.html b/multi/multi_spring-cloud-consul-discovery.html index 28f8263c..26900e29 100644 --- a/multi/multi_spring-cloud-consul-discovery.html +++ b/multi/multi_spring-cloud-consul-discovery.html @@ -38,7 +38,23 @@ consul: discovery: instanceId: ${spring.application.name}:${vcap.application.instance_id:${spring.application.instance_id:${random.value}}}
-
With this metadata, and multiple service instances deployed on localhost, the random value will kick in there to make the instance unique. In Cloudfoundry the vcap.application.instance_id will be populated automatically in a Spring Boot application, so the random value will not be needed.
Spring Cloud has support for Feign (a REST client builder) and also Spring RestTemplate
+
With this metadata, and multiple service instances deployed on localhost, the random value will kick in there to make the instance unique. In Cloudfoundry the vcap.application.instance_id will be populated automatically in a Spring Boot application, so the random value will not be needed.
Headers can be applied to health check requests. For example, if you’re trying to register a Spring Cloud Config server that uses Vault Backend:
application.yml. +
spring: + cloud: + consul: + discovery: + health-check-headers: + X-Config-Token: 6442e58b-d1ea-182e-cfa5-cf9cddef0722
+
According to the HTTP standard, each header can have more than one values, in which case, an array can be supplied:
application.yml. +
spring: + cloud: + consul: + discovery: + health-check-headers: + X-Config-Token: + - "6442e58b-d1ea-182e-cfa5-cf9cddef0722" + - "Some other value"
+
Spring Cloud has support for Feign (a REST client builder) and also Spring RestTemplate
for looking up services using the logical service names/ids instead of physical URLs. Both Feign and the discovery-aware RestTemplate utilize Ribbon for client-side load balancing.
If you want to access service STORES using the RestTemplate simply declare:
@LoadBalanced
@Bean
public RestTemplate loadbalancedRestTemplate() {
diff --git a/multi/multi_spring-cloud-consul.html b/multi/multi_spring-cloud-consul.html
index 8f1f199b..87632578 100644
--- a/multi/multi_spring-cloud-consul.html
+++ b/multi/multi_spring-cloud-consul.html
@@ -1,3 +1,3 @@
- Spring Cloud Consul
\ No newline at end of file
+ Spring Cloud Consul