@ -10,7 +10,15 @@ To disable the composite <code class="literal">HealthIndicator</code>, set <code
@@ -10,7 +10,15 @@ To disable the composite <code class="literal">HealthIndicator</code>, set <code
A generic <codeclass="literal">HealthIndicator</code> based on <codeclass="literal">DiscoveryClient</code> is auto-configured (<codeclass="literal">DiscoveryClientHealthIndicator</code>).
To disable it, set <codeclass="literal">spring.cloud.discovery.client.health-indicator.enabled=false</code>.
To disable the description field of the <codeclass="literal">DiscoveryClientHealthIndicator</code>, set <codeclass="literal">spring.cloud.discovery.client.health-indicator.include-description=false</code>.
Otherwise, it can bubble up as the <codeclass="literal">description</code> of the rolled up <codeclass="literal">HealthIndicator</code>.</p></div></div><divclass="section"><divclass="titlepage"><div><div><h2class="title"style="clear: both"><aname="_serviceregistry"href="#_serviceregistry"></a>2.2 ServiceRegistry</h2></div></div></div><p>Commons now provides a <codeclass="literal">ServiceRegistry</code> interface that provides methods such as <codeclass="literal">register(Registration)</code> and <codeclass="literal">deregister(Registration)</code>, which let you provide custom registered services.
Otherwise, it can bubble up as the <codeclass="literal">description</code> of the rolled up <codeclass="literal">HealthIndicator</code>.</p></div><divclass="section"><divclass="titlepage"><div><div><h3class="title"><aname="_ordering_literal_discoveryclient_literal_instances"href="#_ordering_literal_discoveryclient_literal_instances"></a>2.1.2 Ordering <codeclass="literal">DiscoveryClient</code> instances</h3></div></div></div><p><codeclass="literal">DiscoveryClient</code> interface extends <codeclass="literal">Ordered</code>. This is useful when using multiple discovery
clients, as it allows you to define the order of the returned discovery clients, similar to
how you can order the beans loaded by a Spring application. By default, the order of any <codeclass="literal">DiscoveryClient</code> is set to
<codeclass="literal">0</code>. If you want to set a different order for your custom <codeclass="literal">DiscoveryClient</code> implementations, you just need to override
the <codeclass="literal">getOrder()</code> method so that it returns the value that is suitable for your setup. Apart from this, you can use
properties to set the order of the <codeclass="literal">DiscoveryClient</code>
implementations provided by Spring Cloud, among others <codeclass="literal">ConsulDiscoveryClient</code>, <codeclass="literal">EurekaDiscoveryClient</code> and
<codeclass="literal">ZookeeperDiscoveryClient</code>. In order to do it, you just need to set the
<codeclass="literal">spring.cloud.{clientIdentifier}.discovery.order</code> (or <codeclass="literal">eureka.client.order</code> for Eureka) property to the desired value.</p></div></div><divclass="section"><divclass="titlepage"><div><div><h2class="title"style="clear: both"><aname="_serviceregistry"href="#_serviceregistry"></a>2.2 ServiceRegistry</h2></div></div></div><p>Commons now provides a <codeclass="literal">ServiceRegistry</code> interface that provides methods such as <codeclass="literal">register(Registration)</code> and <codeclass="literal">deregister(Registration)</code>, which let you provide custom registered services.
<codeclass="literal">Registration</code> is a marker interface.</p><p>The following example shows the <codeclass="literal">ServiceRegistry</code> in use:</p><preclass="programlisting"><em><spanclass="hl-annotation"style="color: gray">@Configuration</span></em>
<title>Cloud Native Applications</title><linkrel="stylesheet"type="text/css"href="css/manual-singlepage.css"><metaname="generator"content="DocBook XSL Stylesheets V1.78.1"></head><bodybgcolor="white"text="black"link="#0000FF"vlink="#840084"alink="#0000FF"><divlang="en"class="book"><divclass="titlepage"><div><div><h1class="title"><aname="d0e3"></a>Cloud Native Applications</h1></div></div><hr></div><divclass="toc"><p><b>Table of Contents</b></p><dlclass="toc"><dt><spanclass="preface"><ahref="#d0e9"></a></span></dt><dt><spanclass="chapter"><ahref="#_spring_cloud_context_application_context_services">1. Spring Cloud Context: Application Context Services</a></span></dt><dd><dl><dt><spanclass="section"><ahref="#_the_bootstrap_application_context">1.1. The Bootstrap Application Context</a></span></dt><dt><spanclass="section"><ahref="#_application_context_hierarchies">1.2. Application Context Hierarchies</a></span></dt><dt><spanclass="section"><ahref="#customizing-bootstrap-properties">1.3. Changing the Location of Bootstrap Properties</a></span></dt><dt><spanclass="section"><ahref="#overriding-bootstrap-properties">1.4. Overriding the Values of Remote Properties</a></span></dt><dt><spanclass="section"><ahref="#_customizing_the_bootstrap_configuration">1.5. Customizing the Bootstrap Configuration</a></span></dt><dt><spanclass="section"><ahref="#customizing-bootstrap-property-sources">1.6. Customizing the Bootstrap Property Sources</a></span></dt><dt><spanclass="section"><ahref="#_logging_configuration">1.7. Logging Configuration</a></span></dt><dt><spanclass="section"><ahref="#_environment_changes">1.8. Environment Changes</a></span></dt><dt><spanclass="section"><ahref="#refresh-scope">1.9. Refresh Scope</a></span></dt><dt><spanclass="section"><ahref="#_encryption_and_decryption">1.10. Encryption and Decryption</a></span></dt><dt><spanclass="section"><ahref="#_endpoints">1.11. Endpoints</a></span></dt></dl></dd><dt><spanclass="chapter"><ahref="#_spring_cloud_commons_common_abstractions">2. Spring Cloud Commons: Common Abstractions</a></span></dt><dd><dl><dt><spanclass="section"><ahref="#__enablediscoveryclient">2.1. @EnableDiscoveryClient</a></span></dt><dd><dl><dt><spanclass="section"><ahref="#_health_indicator">2.1.1. Health Indicator</a></span></dt></dl></dd><dt><spanclass="section"><ahref="#_serviceregistry">2.2. ServiceRegistry</a></span></dt><dd><dl><dt><spanclass="section"><ahref="#_serviceregistry_auto_registration">2.2.1. ServiceRegistry Auto-Registration</a></span></dt><dt><spanclass="section"><ahref="#_service_registry_actuator_endpoint">2.2.2. Service Registry Actuator Endpoint</a></span></dt></dl></dd><dt><spanclass="section"><ahref="#_spring_resttemplate_as_a_load_balancer_client">2.3. Spring RestTemplate as a Load Balancer Client</a></span></dt><dt><spanclass="section"><ahref="#_spring_webclient_as_a_load_balancer_client">2.4. Spring WebClient as a Load Balancer Client</a></span></dt><dd><dl><dt><spanclass="section"><ahref="#_retrying_failed_requests">2.4.1. Retrying Failed Requests</a></span></dt></dl></dd><dt><spanclass="section"><ahref="#_multiple_resttemplate_objects">2.5. Multiple RestTemplate objects</a></span></dt><dt><spanclass="section"><ahref="#loadbalanced-webclient">2.6. Spring WebFlux WebClient as a Load Balancer Client</a></span></dt><dt><spanclass="section"><ahref="#ignore-network-interfaces">2.7. Ignore Network Interfaces</a></span></dt><dt><spanclass="section"><ahref="#http-clients">2.8. HTTP Client Factories</a></span></dt><dt><spanclass="section"><ahref="#enabled-features">2.9. Enabled Features</a></span></dt><dd><dl><dt><spanclass="section"><ahref="#_feature_types">2.9.1. Feature types</a></span></dt><dt><spanclass="section"><ahref="#_declaring_features">2.9.2. Declaring features</a></span></dt></dl></dd></dl></dd></dl></div><divclass="preface"><divclass="titlepage"><div><div><h1class="title"><aname="d0e9"href="#d0e9"></a></h1></div></div></div><p><aclass="link"href="http://pivotal.io/platform-as-a-service/migrating-to-cloud-native-application-architectures-ebook"target="_top">Cloud Native</a> is a style of application development that encourages easy adoption of best practices in the areas of continuous delivery and value-driven development.
<title>Cloud Native Applications</title><linkrel="stylesheet"type="text/css"href="css/manual-singlepage.css"><metaname="generator"content="DocBook XSL Stylesheets V1.78.1"></head><bodybgcolor="white"text="black"link="#0000FF"vlink="#840084"alink="#0000FF"><divlang="en"class="book"><divclass="titlepage"><div><div><h1class="title"><aname="d0e3"></a>Cloud Native Applications</h1></div></div><hr></div><divclass="toc"><p><b>Table of Contents</b></p><dlclass="toc"><dt><spanclass="preface"><ahref="#d0e9"></a></span></dt><dt><spanclass="chapter"><ahref="#_spring_cloud_context_application_context_services">1. Spring Cloud Context: Application Context Services</a></span></dt><dd><dl><dt><spanclass="section"><ahref="#_the_bootstrap_application_context">1.1. The Bootstrap Application Context</a></span></dt><dt><spanclass="section"><ahref="#_application_context_hierarchies">1.2. Application Context Hierarchies</a></span></dt><dt><spanclass="section"><ahref="#customizing-bootstrap-properties">1.3. Changing the Location of Bootstrap Properties</a></span></dt><dt><spanclass="section"><ahref="#overriding-bootstrap-properties">1.4. Overriding the Values of Remote Properties</a></span></dt><dt><spanclass="section"><ahref="#_customizing_the_bootstrap_configuration">1.5. Customizing the Bootstrap Configuration</a></span></dt><dt><spanclass="section"><ahref="#customizing-bootstrap-property-sources">1.6. Customizing the Bootstrap Property Sources</a></span></dt><dt><spanclass="section"><ahref="#_logging_configuration">1.7. Logging Configuration</a></span></dt><dt><spanclass="section"><ahref="#_environment_changes">1.8. Environment Changes</a></span></dt><dt><spanclass="section"><ahref="#refresh-scope">1.9. Refresh Scope</a></span></dt><dt><spanclass="section"><ahref="#_encryption_and_decryption">1.10. Encryption and Decryption</a></span></dt><dt><spanclass="section"><ahref="#_endpoints">1.11. Endpoints</a></span></dt></dl></dd><dt><spanclass="chapter"><ahref="#_spring_cloud_commons_common_abstractions">2. Spring Cloud Commons: Common Abstractions</a></span></dt><dd><dl><dt><spanclass="section"><ahref="#__enablediscoveryclient">2.1. @EnableDiscoveryClient</a></span></dt><dd><dl><dt><spanclass="section"><ahref="#_health_indicator">2.1.1. Health Indicator</a></span></dt><dt><spanclass="section"><ahref="#_ordering_literal_discoveryclient_literal_instances">2.1.2. Ordering <codeclass="literal">DiscoveryClient</code> instances</a></span></dt></dl></dd><dt><spanclass="section"><ahref="#_serviceregistry">2.2. ServiceRegistry</a></span></dt><dd><dl><dt><spanclass="section"><ahref="#_serviceregistry_auto_registration">2.2.1. ServiceRegistry Auto-Registration</a></span></dt><dt><spanclass="section"><ahref="#_service_registry_actuator_endpoint">2.2.2. Service Registry Actuator Endpoint</a></span></dt></dl></dd><dt><spanclass="section"><ahref="#_spring_resttemplate_as_a_load_balancer_client">2.3. Spring RestTemplate as a Load Balancer Client</a></span></dt><dt><spanclass="section"><ahref="#_spring_webclient_as_a_load_balancer_client">2.4. Spring WebClient as a Load Balancer Client</a></span></dt><dd><dl><dt><spanclass="section"><ahref="#_retrying_failed_requests">2.4.1. Retrying Failed Requests</a></span></dt></dl></dd><dt><spanclass="section"><ahref="#_multiple_resttemplate_objects">2.5. Multiple RestTemplate objects</a></span></dt><dt><spanclass="section"><ahref="#loadbalanced-webclient">2.6. Spring WebFlux WebClient as a Load Balancer Client</a></span></dt><dt><spanclass="section"><ahref="#ignore-network-interfaces">2.7. Ignore Network Interfaces</a></span></dt><dt><spanclass="section"><ahref="#http-clients">2.8. HTTP Client Factories</a></span></dt><dt><spanclass="section"><ahref="#enabled-features">2.9. Enabled Features</a></span></dt><dd><dl><dt><spanclass="section"><ahref="#_feature_types">2.9.1. Feature types</a></span></dt><dt><spanclass="section"><ahref="#_declaring_features">2.9.2. Declaring features</a></span></dt></dl></dd></dl></dd></dl></div><divclass="preface"><divclass="titlepage"><div><div><h1class="title"><aname="d0e9"href="#d0e9"></a></h1></div></div></div><p><aclass="link"href="http://pivotal.io/platform-as-a-service/migrating-to-cloud-native-application-architectures-ebook"target="_top">Cloud Native</a> is a style of application development that encourages easy adoption of best practices in the areas of continuous delivery and value-driven development.
A related discipline is that of building <aclass="link"href="http://12factor.net/"target="_top">12-factor Applications</a>, in which development practices are aligned with delivery and operations goals — for instance, by using declarative programming and management and monitoring.
Spring Cloud facilitates these styles of development in a number of specific ways.
The starting point is a set of features to which all components in a distributed system need easy access.</p><p>Many of those features are covered by <aclass="link"href="http://projects.spring.io/spring-boot"target="_top">Spring Boot</a>, on which Spring Cloud builds. Some more features are delivered by Spring Cloud as two libraries: Spring Cloud Context and Spring Cloud Commons.
@ -105,7 +105,15 @@ To disable the composite <code class="literal">HealthIndicator</code>, set <code
@@ -105,7 +105,15 @@ To disable the composite <code class="literal">HealthIndicator</code>, set <code
A generic <codeclass="literal">HealthIndicator</code> based on <codeclass="literal">DiscoveryClient</code> is auto-configured (<codeclass="literal">DiscoveryClientHealthIndicator</code>).
To disable it, set <codeclass="literal">spring.cloud.discovery.client.health-indicator.enabled=false</code>.
To disable the description field of the <codeclass="literal">DiscoveryClientHealthIndicator</code>, set <codeclass="literal">spring.cloud.discovery.client.health-indicator.include-description=false</code>.
Otherwise, it can bubble up as the <codeclass="literal">description</code> of the rolled up <codeclass="literal">HealthIndicator</code>.</p></div></div><divclass="section"><divclass="titlepage"><div><div><h2class="title"style="clear: both"><aname="_serviceregistry"href="#_serviceregistry"></a>2.2 ServiceRegistry</h2></div></div></div><p>Commons now provides a <codeclass="literal">ServiceRegistry</code> interface that provides methods such as <codeclass="literal">register(Registration)</code> and <codeclass="literal">deregister(Registration)</code>, which let you provide custom registered services.
Otherwise, it can bubble up as the <codeclass="literal">description</code> of the rolled up <codeclass="literal">HealthIndicator</code>.</p></div><divclass="section"><divclass="titlepage"><div><div><h3class="title"><aname="_ordering_literal_discoveryclient_literal_instances"href="#_ordering_literal_discoveryclient_literal_instances"></a>2.1.2 Ordering <codeclass="literal">DiscoveryClient</code> instances</h3></div></div></div><p><codeclass="literal">DiscoveryClient</code> interface extends <codeclass="literal">Ordered</code>. This is useful when using multiple discovery
clients, as it allows you to define the order of the returned discovery clients, similar to
how you can order the beans loaded by a Spring application. By default, the order of any <codeclass="literal">DiscoveryClient</code> is set to
<codeclass="literal">0</code>. If you want to set a different order for your custom <codeclass="literal">DiscoveryClient</code> implementations, you just need to override
the <codeclass="literal">getOrder()</code> method so that it returns the value that is suitable for your setup. Apart from this, you can use
properties to set the order of the <codeclass="literal">DiscoveryClient</code>
implementations provided by Spring Cloud, among others <codeclass="literal">ConsulDiscoveryClient</code>, <codeclass="literal">EurekaDiscoveryClient</code> and
<codeclass="literal">ZookeeperDiscoveryClient</code>. In order to do it, you just need to set the
<codeclass="literal">spring.cloud.{clientIdentifier}.discovery.order</code> (or <codeclass="literal">eureka.client.order</code> for Eureka) property to the desired value.</p></div></div><divclass="section"><divclass="titlepage"><div><div><h2class="title"style="clear: both"><aname="_serviceregistry"href="#_serviceregistry"></a>2.2 ServiceRegistry</h2></div></div></div><p>Commons now provides a <codeclass="literal">ServiceRegistry</code> interface that provides methods such as <codeclass="literal">register(Registration)</code> and <codeclass="literal">deregister(Registration)</code>, which let you provide custom registered services.
<codeclass="literal">Registration</code> is a marker interface.</p><p>The following example shows the <codeclass="literal">ServiceRegistry</code> in use:</p><preclass="programlisting"><em><spanclass="hl-annotation"style="color: gray">@Configuration</span></em>
@ -280,6 +280,18 @@ To disable it, set <literal>spring.cloud.discovery.client.health-indicator.enabl
@@ -280,6 +280,18 @@ To disable it, set <literal>spring.cloud.discovery.client.health-indicator.enabl
To disable the description field of the <literal>DiscoveryClientHealthIndicator</literal>, set <literal>spring.cloud.discovery.client.health-indicator.include-description=false</literal>.
Otherwise, it can bubble up as the <literal>description</literal> of the rolled up <literal>HealthIndicator</literal>.</simpara>
<simpara><literal>DiscoveryClient</literal> interface extends <literal>Ordered</literal>. This is useful when using multiple discovery
clients, as it allows you to define the order of the returned discovery clients, similar to
how you can order the beans loaded by a Spring application. By default, the order of any <literal>DiscoveryClient</literal> is set to
<literal>0</literal>. If you want to set a different order for your custom <literal>DiscoveryClient</literal> implementations, you just need to override
the <literal>getOrder()</literal> method so that it returns the value that is suitable for your setup. Apart from this, you can use
properties to set the order of the <literal>DiscoveryClient</literal>
implementations provided by Spring Cloud, among others <literal>ConsulDiscoveryClient</literal>, <literal>EurekaDiscoveryClient</literal> and
<literal>ZookeeperDiscoveryClient</literal>. In order to do it, you just need to set the
<literal>spring.cloud.{clientIdentifier}.discovery.order</literal> (or <literal>eureka.client.order</literal> for Eureka) property to the desired value.</simpara>