Sync docs from master to gh-pages

This commit is contained in:
buildmaster
2018-09-29 10:41:55 +00:00
parent 5ad547f78d
commit cfa4dedbe4
12 changed files with 12 additions and 12 deletions

View File

@@ -1,6 +1,6 @@
<html><head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title></title><link rel="stylesheet" type="text/css" href="css/manual-multipage.css"><meta name="generator" content="DocBook XSL Stylesheets V1.78.1"><link rel="home" href="multi_spring-cloud-consul.html" title="Spring Cloud Consul"><link rel="up" href="multi_spring-cloud-consul.html" title="Spring Cloud Consul"><link rel="prev" href="multi_spring-cloud-consul.html" title="Spring Cloud Consul"><link rel="next" href="multi_spring-cloud-consul-install.html" title="1.&nbsp;Install Consul"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center"></th></tr><tr><td width="20%" align="left"><a accesskey="p" href="multi_spring-cloud-consul.html">Prev</a>&nbsp;</td><th width="60%" align="center">&nbsp;</th><td width="20%" align="right">&nbsp;<a accesskey="n" href="multi_spring-cloud-consul-install.html">Next</a></td></tr></table><hr></div><div class="preface"><div class="titlepage"><div><div><h1 class="title"><a name="d0e9" href="#d0e9"></a></h1></div></div></div><p><span class="strong"><strong>2.1.0.BUILD-SNAPSHOT</strong></span></p><p>This project provides Consul integrations for Spring Boot apps through autoconfiguration
<title></title><link rel="stylesheet" type="text/css" href="css/manual-multipage.css"><meta name="generator" content="DocBook XSL Stylesheets V1.79.1"><link rel="home" href="multi_spring-cloud-consul.html" title="Spring Cloud Consul"><link rel="up" href="multi_spring-cloud-consul.html" title="Spring Cloud Consul"><link rel="prev" href="multi_spring-cloud-consul.html" title="Spring Cloud Consul"><link rel="next" href="multi_spring-cloud-consul-install.html" title="1.&nbsp;Install Consul"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center"></th></tr><tr><td width="20%" align="left"><a accesskey="p" href="multi_spring-cloud-consul.html">Prev</a>&nbsp;</td><th width="60%" align="center">&nbsp;</th><td width="20%" align="right">&nbsp;<a accesskey="n" href="multi_spring-cloud-consul-install.html">Next</a></td></tr></table><hr></div><div class="preface"><div class="titlepage"><div><div><h1 class="title"><a name="d0e9" href="#d0e9"></a></h1></div></div></div><p><span class="strong"><strong>2.1.0.BUILD-SNAPSHOT</strong></span></p><p>This project provides Consul integrations for Spring Boot apps through autoconfiguration
and binding to the Spring Environment and other Spring programming model idioms. With a few
simple annotations you can quickly enable and configure the common patterns inside your
application and build large distributed systems with Consul based components. The

View File

@@ -1,3 +1,3 @@
<html><head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>2.&nbsp;Consul Agent</title><link rel="stylesheet" type="text/css" href="css/manual-multipage.css"><meta name="generator" content="DocBook XSL Stylesheets V1.78.1"><link rel="home" href="multi_spring-cloud-consul.html" title="Spring Cloud Consul"><link rel="up" href="multi_spring-cloud-consul.html" title="Spring Cloud Consul"><link rel="prev" href="multi_spring-cloud-consul-install.html" title="1.&nbsp;Install Consul"><link rel="next" href="multi_spring-cloud-consul-discovery.html" title="3.&nbsp;Service Discovery with Consul"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">2.&nbsp;Consul Agent</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="multi_spring-cloud-consul-install.html">Prev</a>&nbsp;</td><th width="60%" align="center">&nbsp;</th><td width="20%" align="right">&nbsp;<a accesskey="n" href="multi_spring-cloud-consul-discovery.html">Next</a></td></tr></table><hr></div><div class="chapter"><div class="titlepage"><div><div><h1 class="title"><a name="spring-cloud-consul-agent" href="#spring-cloud-consul-agent"></a>2.&nbsp;Consul Agent</h1></div></div></div><p>A Consul Agent client must be available to all Spring Cloud Consul applications. By default, the Agent client is expected to be at <code class="literal">localhost:8500</code>. See the <a class="link" href="https://consul.io/docs/agent/basics.html" target="_top">Agent documentation</a> for specifics on how to start an Agent client and how to connect to a cluster of Consul Agent Servers. For development, after you have installed consul, you may start a Consul Agent using the following command:</p><pre class="screen">./src/main/bash/local_run_consul.sh</pre><p>This will start an agent in server mode on port 8500, with the ui available at <a class="link" href="http://localhost:8500" target="_top">http://localhost:8500</a></p></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="multi_spring-cloud-consul-install.html">Prev</a>&nbsp;</td><td width="20%" align="center">&nbsp;</td><td width="40%" align="right">&nbsp;<a accesskey="n" href="multi_spring-cloud-consul-discovery.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">1.&nbsp;Install Consul&nbsp;</td><td width="20%" align="center"><a accesskey="h" href="multi_spring-cloud-consul.html">Home</a></td><td width="40%" align="right" valign="top">&nbsp;3.&nbsp;Service Discovery with Consul</td></tr></table></div></body></html>
<title>2.&nbsp;Consul Agent</title><link rel="stylesheet" type="text/css" href="css/manual-multipage.css"><meta name="generator" content="DocBook XSL Stylesheets V1.79.1"><link rel="home" href="multi_spring-cloud-consul.html" title="Spring Cloud Consul"><link rel="up" href="multi_spring-cloud-consul.html" title="Spring Cloud Consul"><link rel="prev" href="multi_spring-cloud-consul-install.html" title="1.&nbsp;Install Consul"><link rel="next" href="multi_spring-cloud-consul-discovery.html" title="3.&nbsp;Service Discovery with Consul"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">2.&nbsp;Consul Agent</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="multi_spring-cloud-consul-install.html">Prev</a>&nbsp;</td><th width="60%" align="center">&nbsp;</th><td width="20%" align="right">&nbsp;<a accesskey="n" href="multi_spring-cloud-consul-discovery.html">Next</a></td></tr></table><hr></div><div class="chapter"><div class="titlepage"><div><div><h1 class="title"><a name="spring-cloud-consul-agent" href="#spring-cloud-consul-agent"></a>2.&nbsp;Consul Agent</h1></div></div></div><p>A Consul Agent client must be available to all Spring Cloud Consul applications. By default, the Agent client is expected to be at <code class="literal">localhost:8500</code>. See the <a class="link" href="https://consul.io/docs/agent/basics.html" target="_top">Agent documentation</a> for specifics on how to start an Agent client and how to connect to a cluster of Consul Agent Servers. For development, after you have installed consul, you may start a Consul Agent using the following command:</p><pre class="screen">./src/main/bash/local_run_consul.sh</pre><p>This will start an agent in server mode on port 8500, with the ui available at <a class="link" href="http://localhost:8500" target="_top">http://localhost:8500</a></p></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="multi_spring-cloud-consul-install.html">Prev</a>&nbsp;</td><td width="20%" align="center">&nbsp;</td><td width="40%" align="right">&nbsp;<a accesskey="n" href="multi_spring-cloud-consul-discovery.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">1.&nbsp;Install Consul&nbsp;</td><td width="20%" align="center"><a accesskey="h" href="multi_spring-cloud-consul.html">Home</a></td><td width="40%" align="right" valign="top">&nbsp;3.&nbsp;Service Discovery with Consul</td></tr></table></div></body></html>

View File

@@ -1,3 +1,3 @@
<html><head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>6.&nbsp;Spring Cloud Bus with Consul</title><link rel="stylesheet" type="text/css" href="css/manual-multipage.css"><meta name="generator" content="DocBook XSL Stylesheets V1.78.1"><link rel="home" href="multi_spring-cloud-consul.html" title="Spring Cloud Consul"><link rel="up" href="multi_spring-cloud-consul.html" title="Spring Cloud Consul"><link rel="prev" href="multi_spring-cloud-consul-retry.html" title="5.&nbsp;Consul Retry"><link rel="next" href="multi_spring-cloud-consul-hystrix.html" title="7.&nbsp;Circuit Breaker with Hystrix"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">6.&nbsp;Spring Cloud Bus with Consul</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="multi_spring-cloud-consul-retry.html">Prev</a>&nbsp;</td><th width="60%" align="center">&nbsp;</th><td width="20%" align="right">&nbsp;<a accesskey="n" href="multi_spring-cloud-consul-hystrix.html">Next</a></td></tr></table><hr></div><div class="chapter"><div class="titlepage"><div><div><h1 class="title"><a name="spring-cloud-consul-bus" href="#spring-cloud-consul-bus"></a>6.&nbsp;Spring Cloud Bus with Consul</h1></div></div></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="_how_to_activate_3" href="#_how_to_activate_3"></a>6.1&nbsp;How to activate</h2></div></div></div><p>To get started with the Consul Bus use the starter with group <code class="literal">org.springframework.cloud</code> and artifact id <code class="literal">spring-cloud-starter-consul-bus</code>. See the <a class="link" href="http://projects.spring.io/spring-cloud/" target="_top">Spring Cloud Project page</a> for details on setting up your build system with the current Spring Cloud Release Train.</p><p>See the <a class="link" href="https://cloud.spring.io/spring-cloud-bus/" target="_top">Spring Cloud Bus</a> documentation for the available actuator endpoints and howto send custom messages.</p></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="multi_spring-cloud-consul-retry.html">Prev</a>&nbsp;</td><td width="20%" align="center">&nbsp;</td><td width="40%" align="right">&nbsp;<a accesskey="n" href="multi_spring-cloud-consul-hystrix.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">5.&nbsp;Consul Retry&nbsp;</td><td width="20%" align="center"><a accesskey="h" href="multi_spring-cloud-consul.html">Home</a></td><td width="40%" align="right" valign="top">&nbsp;7.&nbsp;Circuit Breaker with Hystrix</td></tr></table></div></body></html>
<title>6.&nbsp;Spring Cloud Bus with Consul</title><link rel="stylesheet" type="text/css" href="css/manual-multipage.css"><meta name="generator" content="DocBook XSL Stylesheets V1.79.1"><link rel="home" href="multi_spring-cloud-consul.html" title="Spring Cloud Consul"><link rel="up" href="multi_spring-cloud-consul.html" title="Spring Cloud Consul"><link rel="prev" href="multi_spring-cloud-consul-retry.html" title="5.&nbsp;Consul Retry"><link rel="next" href="multi_spring-cloud-consul-hystrix.html" title="7.&nbsp;Circuit Breaker with Hystrix"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">6.&nbsp;Spring Cloud Bus with Consul</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="multi_spring-cloud-consul-retry.html">Prev</a>&nbsp;</td><th width="60%" align="center">&nbsp;</th><td width="20%" align="right">&nbsp;<a accesskey="n" href="multi_spring-cloud-consul-hystrix.html">Next</a></td></tr></table><hr></div><div class="chapter"><div class="titlepage"><div><div><h1 class="title"><a name="spring-cloud-consul-bus" href="#spring-cloud-consul-bus"></a>6.&nbsp;Spring Cloud Bus with Consul</h1></div></div></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="_how_to_activate_3" href="#_how_to_activate_3"></a>6.1&nbsp;How to activate</h2></div></div></div><p>To get started with the Consul Bus use the starter with group <code class="literal">org.springframework.cloud</code> and artifact id <code class="literal">spring-cloud-starter-consul-bus</code>. See the <a class="link" href="http://projects.spring.io/spring-cloud/" target="_top">Spring Cloud Project page</a> for details on setting up your build system with the current Spring Cloud Release Train.</p><p>See the <a class="link" href="https://cloud.spring.io/spring-cloud-bus/" target="_top">Spring Cloud Bus</a> documentation for the available actuator endpoints and howto send custom messages.</p></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="multi_spring-cloud-consul-retry.html">Prev</a>&nbsp;</td><td width="20%" align="center">&nbsp;</td><td width="40%" align="right">&nbsp;<a accesskey="n" href="multi_spring-cloud-consul-hystrix.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">5.&nbsp;Consul Retry&nbsp;</td><td width="20%" align="center"><a accesskey="h" href="multi_spring-cloud-consul.html">Home</a></td><td width="40%" align="right" valign="top">&nbsp;7.&nbsp;Circuit Breaker with Hystrix</td></tr></table></div></body></html>

View File

@@ -1,6 +1,6 @@
<html><head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>4.&nbsp;Distributed Configuration with Consul</title><link rel="stylesheet" type="text/css" href="css/manual-multipage.css"><meta name="generator" content="DocBook XSL Stylesheets V1.78.1"><link rel="home" href="multi_spring-cloud-consul.html" title="Spring Cloud Consul"><link rel="up" href="multi_spring-cloud-consul.html" title="Spring Cloud Consul"><link rel="prev" href="multi_spring-cloud-consul-discovery.html" title="3.&nbsp;Service Discovery with Consul"><link rel="next" href="multi_spring-cloud-consul-retry.html" title="5.&nbsp;Consul Retry"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">4.&nbsp;Distributed Configuration with Consul</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="multi_spring-cloud-consul-discovery.html">Prev</a>&nbsp;</td><th width="60%" align="center">&nbsp;</th><td width="20%" align="right">&nbsp;<a accesskey="n" href="multi_spring-cloud-consul-retry.html">Next</a></td></tr></table><hr></div><div class="chapter"><div class="titlepage"><div><div><h1 class="title"><a name="spring-cloud-consul-config" href="#spring-cloud-consul-config"></a>4.&nbsp;Distributed Configuration with Consul</h1></div></div></div><p>Consul provides a <a class="link" href="https://consul.io/docs/agent/http/kv.html" target="_top">Key/Value Store</a> for storing configuration and other metadata. Spring Cloud Consul Config is an alternative to the <a class="link" href="https://github.com/spring-cloud/spring-cloud-config" target="_top">Config Server and Client</a>. Configuration is loaded into the Spring Environment during the special "bootstrap" phase. Configuration is stored in the <code class="literal">/config</code> folder by default. Multiple <code class="literal">PropertySource</code> instances are created based on the application&#8217;s name and the active profiles that mimicks the Spring Cloud Config order of resolving properties. For example, an application with the name "testApp" and with the "dev" profile will have the following property sources created:</p><pre class="screen">config/testApp,dev/
<title>4.&nbsp;Distributed Configuration with Consul</title><link rel="stylesheet" type="text/css" href="css/manual-multipage.css"><meta name="generator" content="DocBook XSL Stylesheets V1.79.1"><link rel="home" href="multi_spring-cloud-consul.html" title="Spring Cloud Consul"><link rel="up" href="multi_spring-cloud-consul.html" title="Spring Cloud Consul"><link rel="prev" href="multi_spring-cloud-consul-discovery.html" title="3.&nbsp;Service Discovery with Consul"><link rel="next" href="multi_spring-cloud-consul-retry.html" title="5.&nbsp;Consul Retry"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">4.&nbsp;Distributed Configuration with Consul</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="multi_spring-cloud-consul-discovery.html">Prev</a>&nbsp;</td><th width="60%" align="center">&nbsp;</th><td width="20%" align="right">&nbsp;<a accesskey="n" href="multi_spring-cloud-consul-retry.html">Next</a></td></tr></table><hr></div><div class="chapter"><div class="titlepage"><div><div><h1 class="title"><a name="spring-cloud-consul-config" href="#spring-cloud-consul-config"></a>4.&nbsp;Distributed Configuration with Consul</h1></div></div></div><p>Consul provides a <a class="link" href="https://consul.io/docs/agent/http/kv.html" target="_top">Key/Value Store</a> for storing configuration and other metadata. Spring Cloud Consul Config is an alternative to the <a class="link" href="https://github.com/spring-cloud/spring-cloud-config" target="_top">Config Server and Client</a>. Configuration is loaded into the Spring Environment during the special "bootstrap" phase. Configuration is stored in the <code class="literal">/config</code> folder by default. Multiple <code class="literal">PropertySource</code> instances are created based on the application&#8217;s name and the active profiles that mimicks the Spring Cloud Config order of resolving properties. For example, an application with the name "testApp" and with the "dev" profile will have the following property sources created:</p><pre class="screen">config/testApp,dev/
config/testApp/
config/application,dev/
config/application/</pre><p>The most specific property source is at the top, with the least specific at the bottom. Properties in the <code class="literal">config/application</code> folder are applicable to all applications using consul for configuration. Properties in the <code class="literal">config/testApp</code> folder are only available to the instances of the service named "testApp".</p><p>Configuration is currently read on startup of the application. Sending a HTTP POST to <code class="literal">/refresh</code> will cause the configuration to be reloaded. <a class="xref" href="multi_spring-cloud-consul-config.html#spring-cloud-consul-config-watch" title="4.3&nbsp;Config Watch">Section&nbsp;4.3, &#8220;Config Watch&#8221;</a> will also automatically detect changes and reload the application context.</p><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="_how_to_activate_2" href="#_how_to_activate_2"></a>4.1&nbsp;How to activate</h2></div></div></div><p>To get started with Consul Configuration use the starter with group <code class="literal">org.springframework.cloud</code> and artifact id <code class="literal">spring-cloud-starter-consul-config</code>. See the <a class="link" href="http://projects.spring.io/spring-cloud/" target="_top">Spring Cloud Project page</a> for details on setting up your build system with the current Spring Cloud Release Train.</p><p>This will enable auto-configuration that will setup Spring Cloud Consul Config.</p></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="_customizing" href="#_customizing"></a>4.2&nbsp;Customizing</h2></div></div></div><p>Consul Config may be customized using the following properties:</p><p><b>bootstrap.yml.&nbsp;</b>

View File

@@ -1,6 +1,6 @@
<html><head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>3.&nbsp;Service Discovery with Consul</title><link rel="stylesheet" type="text/css" href="css/manual-multipage.css"><meta name="generator" content="DocBook XSL Stylesheets V1.78.1"><link rel="home" href="multi_spring-cloud-consul.html" title="Spring Cloud Consul"><link rel="up" href="multi_spring-cloud-consul.html" title="Spring Cloud Consul"><link rel="prev" href="multi_spring-cloud-consul-agent.html" title="2.&nbsp;Consul Agent"><link rel="next" href="multi_spring-cloud-consul-config.html" title="4.&nbsp;Distributed Configuration with Consul"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">3.&nbsp;Service Discovery with Consul</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="multi_spring-cloud-consul-agent.html">Prev</a>&nbsp;</td><th width="60%" align="center">&nbsp;</th><td width="20%" align="right">&nbsp;<a accesskey="n" href="multi_spring-cloud-consul-config.html">Next</a></td></tr></table><hr></div><div class="chapter"><div class="titlepage"><div><div><h1 class="title"><a name="spring-cloud-consul-discovery" href="#spring-cloud-consul-discovery"></a>3.&nbsp;Service Discovery with Consul</h1></div></div></div><p>Service Discovery is one of the key tenets of a microservice based architecture. Trying to hand configure each client or some form of convention can be very difficult to do and can be very brittle. Consul provides Service Discovery services via an <a class="link" href="https://www.consul.io/docs/agent/http.html" target="_top">HTTP API</a> and <a class="link" href="https://www.consul.io/docs/agent/dns.html" target="_top">DNS</a>. Spring Cloud Consul leverages the HTTP API for service registration and discovery. This does not prevent non-Spring Cloud applications from leveraging the DNS interface. Consul Agents servers are run in a <a class="link" href="https://www.consul.io/docs/internals/architecture.html" target="_top">cluster</a> that communicates via a <a class="link" href="https://www.consul.io/docs/internals/gossip.html" target="_top">gossip protocol</a> and uses the <a class="link" href="https://www.consul.io/docs/internals/consensus.html" target="_top">Raft consensus protocol</a>.</p><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="_how_to_activate" href="#_how_to_activate"></a>3.1&nbsp;How to activate</h2></div></div></div><p>To activate Consul Service Discovery use the starter with group <code class="literal">org.springframework.cloud</code> and artifact id <code class="literal">spring-cloud-starter-consul-discovery</code>. See the <a class="link" href="http://projects.spring.io/spring-cloud/" target="_top">Spring Cloud Project page</a> for details on setting up your build system with the current Spring Cloud Release Train.</p></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="_registering_with_consul" href="#_registering_with_consul"></a>3.2&nbsp;Registering with Consul</h2></div></div></div><p>When a client registers with Consul, it provides meta-data about itself such as host and port, id, name and tags. An HTTP <a class="link" href="https://www.consul.io/docs/agent/checks.html" target="_top">Check</a> is created by default that Consul hits the <code class="literal">/health</code> endpoint every 10 seconds. If the health check fails, the service instance is marked as critical.</p><p>Example Consul client:</p><pre class="programlisting"><em><span class="hl-annotation" style="color: gray">@SpringBootApplication</span></em>
<title>3.&nbsp;Service Discovery with Consul</title><link rel="stylesheet" type="text/css" href="css/manual-multipage.css"><meta name="generator" content="DocBook XSL Stylesheets V1.79.1"><link rel="home" href="multi_spring-cloud-consul.html" title="Spring Cloud Consul"><link rel="up" href="multi_spring-cloud-consul.html" title="Spring Cloud Consul"><link rel="prev" href="multi_spring-cloud-consul-agent.html" title="2.&nbsp;Consul Agent"><link rel="next" href="multi_spring-cloud-consul-config.html" title="4.&nbsp;Distributed Configuration with Consul"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">3.&nbsp;Service Discovery with Consul</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="multi_spring-cloud-consul-agent.html">Prev</a>&nbsp;</td><th width="60%" align="center">&nbsp;</th><td width="20%" align="right">&nbsp;<a accesskey="n" href="multi_spring-cloud-consul-config.html">Next</a></td></tr></table><hr></div><div class="chapter"><div class="titlepage"><div><div><h1 class="title"><a name="spring-cloud-consul-discovery" href="#spring-cloud-consul-discovery"></a>3.&nbsp;Service Discovery with Consul</h1></div></div></div><p>Service Discovery is one of the key tenets of a microservice based architecture. Trying to hand configure each client or some form of convention can be very difficult to do and can be very brittle. Consul provides Service Discovery services via an <a class="link" href="https://www.consul.io/docs/agent/http.html" target="_top">HTTP API</a> and <a class="link" href="https://www.consul.io/docs/agent/dns.html" target="_top">DNS</a>. Spring Cloud Consul leverages the HTTP API for service registration and discovery. This does not prevent non-Spring Cloud applications from leveraging the DNS interface. Consul Agents servers are run in a <a class="link" href="https://www.consul.io/docs/internals/architecture.html" target="_top">cluster</a> that communicates via a <a class="link" href="https://www.consul.io/docs/internals/gossip.html" target="_top">gossip protocol</a> and uses the <a class="link" href="https://www.consul.io/docs/internals/consensus.html" target="_top">Raft consensus protocol</a>.</p><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="_how_to_activate" href="#_how_to_activate"></a>3.1&nbsp;How to activate</h2></div></div></div><p>To activate Consul Service Discovery use the starter with group <code class="literal">org.springframework.cloud</code> and artifact id <code class="literal">spring-cloud-starter-consul-discovery</code>. See the <a class="link" href="http://projects.spring.io/spring-cloud/" target="_top">Spring Cloud Project page</a> for details on setting up your build system with the current Spring Cloud Release Train.</p></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="_registering_with_consul" href="#_registering_with_consul"></a>3.2&nbsp;Registering with Consul</h2></div></div></div><p>When a client registers with Consul, it provides meta-data about itself such as host and port, id, name and tags. An HTTP <a class="link" href="https://www.consul.io/docs/agent/checks.html" target="_top">Check</a> is created by default that Consul hits the <code class="literal">/health</code> endpoint every 10 seconds. If the health check fails, the service instance is marked as critical.</p><p>Example Consul client:</p><pre class="programlisting"><em><span class="hl-annotation" style="color: gray">@SpringBootApplication</span></em>
<em><span class="hl-annotation" style="color: gray">@RestController</span></em>
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">public</span> <span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">class</span> Application {

View File

@@ -1,3 +1,3 @@
<html><head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>7.&nbsp;Circuit Breaker with Hystrix</title><link rel="stylesheet" type="text/css" href="css/manual-multipage.css"><meta name="generator" content="DocBook XSL Stylesheets V1.78.1"><link rel="home" href="multi_spring-cloud-consul.html" title="Spring Cloud Consul"><link rel="up" href="multi_spring-cloud-consul.html" title="Spring Cloud Consul"><link rel="prev" href="multi_spring-cloud-consul-bus.html" title="6.&nbsp;Spring Cloud Bus with Consul"><link rel="next" href="multi_spring-cloud-consul-turbine.html" title="8.&nbsp;Hystrix metrics aggregation with Turbine and Consul"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">7.&nbsp;Circuit Breaker with Hystrix</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="multi_spring-cloud-consul-bus.html">Prev</a>&nbsp;</td><th width="60%" align="center">&nbsp;</th><td width="20%" align="right">&nbsp;<a accesskey="n" href="multi_spring-cloud-consul-turbine.html">Next</a></td></tr></table><hr></div><div class="chapter"><div class="titlepage"><div><div><h1 class="title"><a name="spring-cloud-consul-hystrix" href="#spring-cloud-consul-hystrix"></a>7.&nbsp;Circuit Breaker with Hystrix</h1></div></div></div><p>Applications can use the Hystrix Circuit Breaker provided by the Spring Cloud Netflix project by including this starter in the projects pom.xml: <code class="literal">spring-cloud-starter-hystrix</code>. Hystrix doesn&#8217;t depend on the Netflix Discovery Client. The <code class="literal">@EnableHystrix</code> annotation should be placed on a configuration class (usually the main class). Then methods can be annotated with <code class="literal">@HystrixCommand</code> to be protected by a circuit breaker. See <a class="link" href="http://projects.spring.io/spring-cloud/spring-cloud.html#_circuit_breaker_hystrix_clients" target="_top">the documentation</a> for more details.</p></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="multi_spring-cloud-consul-bus.html">Prev</a>&nbsp;</td><td width="20%" align="center">&nbsp;</td><td width="40%" align="right">&nbsp;<a accesskey="n" href="multi_spring-cloud-consul-turbine.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">6.&nbsp;Spring Cloud Bus with Consul&nbsp;</td><td width="20%" align="center"><a accesskey="h" href="multi_spring-cloud-consul.html">Home</a></td><td width="40%" align="right" valign="top">&nbsp;8.&nbsp;Hystrix metrics aggregation with Turbine and Consul</td></tr></table></div></body></html>
<title>7.&nbsp;Circuit Breaker with Hystrix</title><link rel="stylesheet" type="text/css" href="css/manual-multipage.css"><meta name="generator" content="DocBook XSL Stylesheets V1.79.1"><link rel="home" href="multi_spring-cloud-consul.html" title="Spring Cloud Consul"><link rel="up" href="multi_spring-cloud-consul.html" title="Spring Cloud Consul"><link rel="prev" href="multi_spring-cloud-consul-bus.html" title="6.&nbsp;Spring Cloud Bus with Consul"><link rel="next" href="multi_spring-cloud-consul-turbine.html" title="8.&nbsp;Hystrix metrics aggregation with Turbine and Consul"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">7.&nbsp;Circuit Breaker with Hystrix</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="multi_spring-cloud-consul-bus.html">Prev</a>&nbsp;</td><th width="60%" align="center">&nbsp;</th><td width="20%" align="right">&nbsp;<a accesskey="n" href="multi_spring-cloud-consul-turbine.html">Next</a></td></tr></table><hr></div><div class="chapter"><div class="titlepage"><div><div><h1 class="title"><a name="spring-cloud-consul-hystrix" href="#spring-cloud-consul-hystrix"></a>7.&nbsp;Circuit Breaker with Hystrix</h1></div></div></div><p>Applications can use the Hystrix Circuit Breaker provided by the Spring Cloud Netflix project by including this starter in the projects pom.xml: <code class="literal">spring-cloud-starter-hystrix</code>. Hystrix doesn&#8217;t depend on the Netflix Discovery Client. The <code class="literal">@EnableHystrix</code> annotation should be placed on a configuration class (usually the main class). Then methods can be annotated with <code class="literal">@HystrixCommand</code> to be protected by a circuit breaker. See <a class="link" href="http://projects.spring.io/spring-cloud/spring-cloud.html#_circuit_breaker_hystrix_clients" target="_top">the documentation</a> for more details.</p></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="multi_spring-cloud-consul-bus.html">Prev</a>&nbsp;</td><td width="20%" align="center">&nbsp;</td><td width="40%" align="right">&nbsp;<a accesskey="n" href="multi_spring-cloud-consul-turbine.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">6.&nbsp;Spring Cloud Bus with Consul&nbsp;</td><td width="20%" align="center"><a accesskey="h" href="multi_spring-cloud-consul.html">Home</a></td><td width="40%" align="right" valign="top">&nbsp;8.&nbsp;Hystrix metrics aggregation with Turbine and Consul</td></tr></table></div></body></html>

View File

@@ -1,3 +1,3 @@
<html><head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>1.&nbsp;Install Consul</title><link rel="stylesheet" type="text/css" href="css/manual-multipage.css"><meta name="generator" content="DocBook XSL Stylesheets V1.78.1"><link rel="home" href="multi_spring-cloud-consul.html" title="Spring Cloud Consul"><link rel="up" href="multi_spring-cloud-consul.html" title="Spring Cloud Consul"><link rel="prev" href="multi_pr01.html" title=""><link rel="next" href="multi_spring-cloud-consul-agent.html" title="2.&nbsp;Consul Agent"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">1.&nbsp;Install Consul</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="multi_pr01.html">Prev</a>&nbsp;</td><th width="60%" align="center">&nbsp;</th><td width="20%" align="right">&nbsp;<a accesskey="n" href="multi_spring-cloud-consul-agent.html">Next</a></td></tr></table><hr></div><div class="chapter"><div class="titlepage"><div><div><h1 class="title"><a name="spring-cloud-consul-install" href="#spring-cloud-consul-install"></a>1.&nbsp;Install Consul</h1></div></div></div><p>Please see the <a class="link" href="https://www.consul.io/intro/getting-started/install.html" target="_top">installation documentation</a> for instructions on how to install Consul.</p></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="multi_pr01.html">Prev</a>&nbsp;</td><td width="20%" align="center">&nbsp;</td><td width="40%" align="right">&nbsp;<a accesskey="n" href="multi_spring-cloud-consul-agent.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">&nbsp;</td><td width="20%" align="center"><a accesskey="h" href="multi_spring-cloud-consul.html">Home</a></td><td width="40%" align="right" valign="top">&nbsp;2.&nbsp;Consul Agent</td></tr></table></div></body></html>
<title>1.&nbsp;Install Consul</title><link rel="stylesheet" type="text/css" href="css/manual-multipage.css"><meta name="generator" content="DocBook XSL Stylesheets V1.79.1"><link rel="home" href="multi_spring-cloud-consul.html" title="Spring Cloud Consul"><link rel="up" href="multi_spring-cloud-consul.html" title="Spring Cloud Consul"><link rel="prev" href="multi_pr01.html" title=""><link rel="next" href="multi_spring-cloud-consul-agent.html" title="2.&nbsp;Consul Agent"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">1.&nbsp;Install Consul</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="multi_pr01.html">Prev</a>&nbsp;</td><th width="60%" align="center">&nbsp;</th><td width="20%" align="right">&nbsp;<a accesskey="n" href="multi_spring-cloud-consul-agent.html">Next</a></td></tr></table><hr></div><div class="chapter"><div class="titlepage"><div><div><h1 class="title"><a name="spring-cloud-consul-install" href="#spring-cloud-consul-install"></a>1.&nbsp;Install Consul</h1></div></div></div><p>Please see the <a class="link" href="https://www.consul.io/intro/getting-started/install.html" target="_top">installation documentation</a> for instructions on how to install Consul.</p></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="multi_pr01.html">Prev</a>&nbsp;</td><td width="20%" align="center">&nbsp;</td><td width="40%" align="right">&nbsp;<a accesskey="n" href="multi_spring-cloud-consul-agent.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">&nbsp;</td><td width="20%" align="center"><a accesskey="h" href="multi_spring-cloud-consul.html">Home</a></td><td width="40%" align="right" valign="top">&nbsp;2.&nbsp;Consul Agent</td></tr></table></div></body></html>

View File

@@ -1,6 +1,6 @@
<html><head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>5.&nbsp;Consul Retry</title><link rel="stylesheet" type="text/css" href="css/manual-multipage.css"><meta name="generator" content="DocBook XSL Stylesheets V1.78.1"><link rel="home" href="multi_spring-cloud-consul.html" title="Spring Cloud Consul"><link rel="up" href="multi_spring-cloud-consul.html" title="Spring Cloud Consul"><link rel="prev" href="multi_spring-cloud-consul-config.html" title="4.&nbsp;Distributed Configuration with Consul"><link rel="next" href="multi_spring-cloud-consul-bus.html" title="6.&nbsp;Spring Cloud Bus with Consul"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">5.&nbsp;Consul Retry</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="multi_spring-cloud-consul-config.html">Prev</a>&nbsp;</td><th width="60%" align="center">&nbsp;</th><td width="20%" align="right">&nbsp;<a accesskey="n" href="multi_spring-cloud-consul-bus.html">Next</a></td></tr></table><hr></div><div class="chapter"><div class="titlepage"><div><div><h1 class="title"><a name="spring-cloud-consul-retry" href="#spring-cloud-consul-retry"></a>5.&nbsp;Consul Retry</h1></div></div></div><p>If you expect that the consul agent may occasionally be unavailable when
<title>5.&nbsp;Consul Retry</title><link rel="stylesheet" type="text/css" href="css/manual-multipage.css"><meta name="generator" content="DocBook XSL Stylesheets V1.79.1"><link rel="home" href="multi_spring-cloud-consul.html" title="Spring Cloud Consul"><link rel="up" href="multi_spring-cloud-consul.html" title="Spring Cloud Consul"><link rel="prev" href="multi_spring-cloud-consul-config.html" title="4.&nbsp;Distributed Configuration with Consul"><link rel="next" href="multi_spring-cloud-consul-bus.html" title="6.&nbsp;Spring Cloud Bus with Consul"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">5.&nbsp;Consul Retry</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="multi_spring-cloud-consul-config.html">Prev</a>&nbsp;</td><th width="60%" align="center">&nbsp;</th><td width="20%" align="right">&nbsp;<a accesskey="n" href="multi_spring-cloud-consul-bus.html">Next</a></td></tr></table><hr></div><div class="chapter"><div class="titlepage"><div><div><h1 class="title"><a name="spring-cloud-consul-retry" href="#spring-cloud-consul-retry"></a>5.&nbsp;Consul Retry</h1></div></div></div><p>If you expect that the consul agent may occasionally be unavailable when
your app starts, you can ask it to keep trying after a failure. You need to add
<code class="literal">spring-retry</code> and <code class="literal">spring-boot-starter-aop</code> to your classpath. The default
behaviour is to retry 6 times with an initial backoff interval of 1000ms and an

View File

@@ -1,6 +1,6 @@
<html><head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>8.&nbsp;Hystrix metrics aggregation with Turbine and Consul</title><link rel="stylesheet" type="text/css" href="css/manual-multipage.css"><meta name="generator" content="DocBook XSL Stylesheets V1.78.1"><link rel="home" href="multi_spring-cloud-consul.html" title="Spring Cloud Consul"><link rel="up" href="multi_spring-cloud-consul.html" title="Spring Cloud Consul"><link rel="prev" href="multi_spring-cloud-consul-hystrix.html" title="7.&nbsp;Circuit Breaker with Hystrix"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">8.&nbsp;Hystrix metrics aggregation with Turbine and Consul</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="multi_spring-cloud-consul-hystrix.html">Prev</a>&nbsp;</td><th width="60%" align="center">&nbsp;</th><td width="20%" align="right">&nbsp;</td></tr></table><hr></div><div class="chapter"><div class="titlepage"><div><div><h1 class="title"><a name="spring-cloud-consul-turbine" href="#spring-cloud-consul-turbine"></a>8.&nbsp;Hystrix metrics aggregation with Turbine and Consul</h1></div></div></div><p>Turbine (provided by the Spring Cloud Netflix project), aggregates multiple instances Hystrix metrics streams, so the dashboard can display an aggregate view. Turbine uses the <code class="literal">DiscoveryClient</code> interface to lookup relevant instances. To use Turbine with Spring Cloud Consul, configure the Turbine application in a manner similar to the following examples:</p><p><b>pom.xml.&nbsp;</b>
<title>8.&nbsp;Hystrix metrics aggregation with Turbine and Consul</title><link rel="stylesheet" type="text/css" href="css/manual-multipage.css"><meta name="generator" content="DocBook XSL Stylesheets V1.79.1"><link rel="home" href="multi_spring-cloud-consul.html" title="Spring Cloud Consul"><link rel="up" href="multi_spring-cloud-consul.html" title="Spring Cloud Consul"><link rel="prev" href="multi_spring-cloud-consul-hystrix.html" title="7.&nbsp;Circuit Breaker with Hystrix"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">8.&nbsp;Hystrix metrics aggregation with Turbine and Consul</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="multi_spring-cloud-consul-hystrix.html">Prev</a>&nbsp;</td><th width="60%" align="center">&nbsp;</th><td width="20%" align="right">&nbsp;</td></tr></table><hr></div><div class="chapter"><div class="titlepage"><div><div><h1 class="title"><a name="spring-cloud-consul-turbine" href="#spring-cloud-consul-turbine"></a>8.&nbsp;Hystrix metrics aggregation with Turbine and Consul</h1></div></div></div><p>Turbine (provided by the Spring Cloud Netflix project), aggregates multiple instances Hystrix metrics streams, so the dashboard can display an aggregate view. Turbine uses the <code class="literal">DiscoveryClient</code> interface to lookup relevant instances. To use Turbine with Spring Cloud Consul, configure the Turbine application in a manner similar to the following examples:</p><p><b>pom.xml.&nbsp;</b>
</p><pre class="screen">&lt;dependency&gt;
&lt;groupId&gt;org.springframework.cloud&lt;/groupId&gt;
&lt;artifactId&gt;spring-cloud-netflix-turbine&lt;/artifactId&gt;

View File

@@ -1,3 +1,3 @@
<html><head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Spring Cloud Consul</title><link rel="stylesheet" type="text/css" href="css/manual-multipage.css"><meta name="generator" content="DocBook XSL Stylesheets V1.78.1"><link rel="home" href="multi_spring-cloud-consul.html" title="Spring Cloud Consul"><link rel="next" href="multi_pr01.html" title=""></head><body class="firstpage" bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Spring Cloud Consul</th></tr><tr><td width="20%" align="left">&nbsp;</td><th width="60%" align="center">&nbsp;</th><td width="20%" align="right">&nbsp;<a accesskey="n" href="multi_pr01.html">Next</a></td></tr></table><hr></div><div lang="en" class="book"><div class="titlepage"><div><div><h1 class="title"><a name="d0e3"></a>Spring Cloud Consul</h1></div></div><hr></div><div class="toc"><p><b>Table of Contents</b></p><dl class="toc"><dt><span class="preface"><a href="multi_pr01.html"></a></span></dt><dt><span class="chapter"><a href="multi_spring-cloud-consul-install.html">1. Install Consul</a></span></dt><dt><span class="chapter"><a href="multi_spring-cloud-consul-agent.html">2. Consul Agent</a></span></dt><dt><span class="chapter"><a href="multi_spring-cloud-consul-discovery.html">3. Service Discovery with Consul</a></span></dt><dd><dl><dt><span class="section"><a href="multi_spring-cloud-consul-discovery.html#_how_to_activate">3.1. How to activate</a></span></dt><dt><span class="section"><a href="multi_spring-cloud-consul-discovery.html#_registering_with_consul">3.2. Registering with Consul</a></span></dt><dt><span class="section"><a href="multi_spring-cloud-consul-discovery.html#_http_health_check">3.3. HTTP Health Check</a></span></dt><dd><dl><dt><span class="section"><a href="multi_spring-cloud-consul-discovery.html#_metadata_and_consul_tags">3.3.1. Metadata and Consul tags</a></span></dt><dt><span class="section"><a href="multi_spring-cloud-consul-discovery.html#_making_the_consul_instance_id_unique">3.3.2. Making the Consul Instance ID Unique</a></span></dt><dt><span class="section"><a href="multi_spring-cloud-consul-discovery.html#_applying_headers_to_health_check_requests">3.3.3. Applying Headers to Health Check Requests</a></span></dt></dl></dd><dt><span class="section"><a href="multi_spring-cloud-consul-discovery.html#_looking_up_services">3.4. Looking up services</a></span></dt><dd><dl><dt><span class="section"><a href="multi_spring-cloud-consul-discovery.html#_using_ribbon">3.4.1. Using Ribbon</a></span></dt><dt><span class="section"><a href="multi_spring-cloud-consul-discovery.html#_using_the_discoveryclient">3.4.2. Using the DiscoveryClient</a></span></dt></dl></dd><dt><span class="section"><a href="multi_spring-cloud-consul-discovery.html#_consul_catalog_watch">3.5. Consul Catalog Watch</a></span></dt></dl></dd><dt><span class="chapter"><a href="multi_spring-cloud-consul-config.html">4. Distributed Configuration with Consul</a></span></dt><dd><dl><dt><span class="section"><a href="multi_spring-cloud-consul-config.html#_how_to_activate_2">4.1. How to activate</a></span></dt><dt><span class="section"><a href="multi_spring-cloud-consul-config.html#_customizing">4.2. Customizing</a></span></dt><dt><span class="section"><a href="multi_spring-cloud-consul-config.html#spring-cloud-consul-config-watch">4.3. Config Watch</a></span></dt><dt><span class="section"><a href="multi_spring-cloud-consul-config.html#spring-cloud-consul-config-format">4.4. YAML or Properties with Config</a></span></dt><dt><span class="section"><a href="multi_spring-cloud-consul-config.html#spring-cloud-consul-config-git2consul">4.5. git2consul with Config</a></span></dt><dt><span class="section"><a href="multi_spring-cloud-consul-config.html#spring-cloud-consul-failfast">4.6. Fail Fast</a></span></dt></dl></dd><dt><span class="chapter"><a href="multi_spring-cloud-consul-retry.html">5. Consul Retry</a></span></dt><dt><span class="chapter"><a href="multi_spring-cloud-consul-bus.html">6. Spring Cloud Bus with Consul</a></span></dt><dd><dl><dt><span class="section"><a href="multi_spring-cloud-consul-bus.html#_how_to_activate_3">6.1. How to activate</a></span></dt></dl></dd><dt><span class="chapter"><a href="multi_spring-cloud-consul-hystrix.html">7. Circuit Breaker with Hystrix</a></span></dt><dt><span class="chapter"><a href="multi_spring-cloud-consul-turbine.html">8. Hystrix metrics aggregation with Turbine and Consul</a></span></dt></dl></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left">&nbsp;</td><td width="20%" align="center">&nbsp;</td><td width="40%" align="right">&nbsp;<a accesskey="n" href="multi_pr01.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">&nbsp;</td><td width="20%" align="center">&nbsp;</td><td width="40%" align="right" valign="top">&nbsp;</td></tr></table></div></body></html>
<title>Spring Cloud Consul</title><link rel="stylesheet" type="text/css" href="css/manual-multipage.css"><meta name="generator" content="DocBook XSL Stylesheets V1.79.1"><link rel="home" href="multi_spring-cloud-consul.html" title="Spring Cloud Consul"><link rel="next" href="multi_pr01.html" title=""></head><body class="firstpage" bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Spring Cloud Consul</th></tr><tr><td width="20%" align="left">&nbsp;</td><th width="60%" align="center">&nbsp;</th><td width="20%" align="right">&nbsp;<a accesskey="n" href="multi_pr01.html">Next</a></td></tr></table><hr></div><div lang="en" class="book"><div class="titlepage"><div><div><h1 class="title"><a name="d0e3"></a>Spring Cloud Consul</h1></div></div><hr></div><div class="toc"><p><b>Table of Contents</b></p><dl class="toc"><dt><span class="preface"><a href="multi_pr01.html"></a></span></dt><dt><span class="chapter"><a href="multi_spring-cloud-consul-install.html">1. Install Consul</a></span></dt><dt><span class="chapter"><a href="multi_spring-cloud-consul-agent.html">2. Consul Agent</a></span></dt><dt><span class="chapter"><a href="multi_spring-cloud-consul-discovery.html">3. Service Discovery with Consul</a></span></dt><dd><dl><dt><span class="section"><a href="multi_spring-cloud-consul-discovery.html#_how_to_activate">3.1. How to activate</a></span></dt><dt><span class="section"><a href="multi_spring-cloud-consul-discovery.html#_registering_with_consul">3.2. Registering with Consul</a></span></dt><dt><span class="section"><a href="multi_spring-cloud-consul-discovery.html#_http_health_check">3.3. HTTP Health Check</a></span></dt><dd><dl><dt><span class="section"><a href="multi_spring-cloud-consul-discovery.html#_metadata_and_consul_tags">3.3.1. Metadata and Consul tags</a></span></dt><dt><span class="section"><a href="multi_spring-cloud-consul-discovery.html#_making_the_consul_instance_id_unique">3.3.2. Making the Consul Instance ID Unique</a></span></dt><dt><span class="section"><a href="multi_spring-cloud-consul-discovery.html#_applying_headers_to_health_check_requests">3.3.3. Applying Headers to Health Check Requests</a></span></dt></dl></dd><dt><span class="section"><a href="multi_spring-cloud-consul-discovery.html#_looking_up_services">3.4. Looking up services</a></span></dt><dd><dl><dt><span class="section"><a href="multi_spring-cloud-consul-discovery.html#_using_ribbon">3.4.1. Using Ribbon</a></span></dt><dt><span class="section"><a href="multi_spring-cloud-consul-discovery.html#_using_the_discoveryclient">3.4.2. Using the DiscoveryClient</a></span></dt></dl></dd><dt><span class="section"><a href="multi_spring-cloud-consul-discovery.html#_consul_catalog_watch">3.5. Consul Catalog Watch</a></span></dt></dl></dd><dt><span class="chapter"><a href="multi_spring-cloud-consul-config.html">4. Distributed Configuration with Consul</a></span></dt><dd><dl><dt><span class="section"><a href="multi_spring-cloud-consul-config.html#_how_to_activate_2">4.1. How to activate</a></span></dt><dt><span class="section"><a href="multi_spring-cloud-consul-config.html#_customizing">4.2. Customizing</a></span></dt><dt><span class="section"><a href="multi_spring-cloud-consul-config.html#spring-cloud-consul-config-watch">4.3. Config Watch</a></span></dt><dt><span class="section"><a href="multi_spring-cloud-consul-config.html#spring-cloud-consul-config-format">4.4. YAML or Properties with Config</a></span></dt><dt><span class="section"><a href="multi_spring-cloud-consul-config.html#spring-cloud-consul-config-git2consul">4.5. git2consul with Config</a></span></dt><dt><span class="section"><a href="multi_spring-cloud-consul-config.html#spring-cloud-consul-failfast">4.6. Fail Fast</a></span></dt></dl></dd><dt><span class="chapter"><a href="multi_spring-cloud-consul-retry.html">5. Consul Retry</a></span></dt><dt><span class="chapter"><a href="multi_spring-cloud-consul-bus.html">6. Spring Cloud Bus with Consul</a></span></dt><dd><dl><dt><span class="section"><a href="multi_spring-cloud-consul-bus.html#_how_to_activate_3">6.1. How to activate</a></span></dt></dl></dd><dt><span class="chapter"><a href="multi_spring-cloud-consul-hystrix.html">7. Circuit Breaker with Hystrix</a></span></dt><dt><span class="chapter"><a href="multi_spring-cloud-consul-turbine.html">8. Hystrix metrics aggregation with Turbine and Consul</a></span></dt></dl></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left">&nbsp;</td><td width="20%" align="center">&nbsp;</td><td width="40%" align="right">&nbsp;<a accesskey="n" href="multi_pr01.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">&nbsp;</td><td width="20%" align="center">&nbsp;</td><td width="40%" align="right" valign="top">&nbsp;</td></tr></table></div></body></html>

View File

@@ -1,6 +1,6 @@
<html><head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Spring Cloud Consul</title><link rel="stylesheet" type="text/css" href="css/manual-singlepage.css"><meta name="generator" content="DocBook XSL Stylesheets V1.78.1"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div lang="en" class="book"><div class="titlepage"><div><div><h1 class="title"><a name="d0e3"></a>Spring Cloud Consul</h1></div></div><hr></div><div class="toc"><p><b>Table of Contents</b></p><dl class="toc"><dt><span class="preface"><a href="#d0e9"></a></span></dt><dt><span class="chapter"><a href="#spring-cloud-consul-install">1. Install Consul</a></span></dt><dt><span class="chapter"><a href="#spring-cloud-consul-agent">2. Consul Agent</a></span></dt><dt><span class="chapter"><a href="#spring-cloud-consul-discovery">3. Service Discovery with Consul</a></span></dt><dd><dl><dt><span class="section"><a href="#_how_to_activate">3.1. How to activate</a></span></dt><dt><span class="section"><a href="#_registering_with_consul">3.2. Registering with Consul</a></span></dt><dt><span class="section"><a href="#_http_health_check">3.3. HTTP Health Check</a></span></dt><dd><dl><dt><span class="section"><a href="#_metadata_and_consul_tags">3.3.1. Metadata and Consul tags</a></span></dt><dt><span class="section"><a href="#_making_the_consul_instance_id_unique">3.3.2. Making the Consul Instance ID Unique</a></span></dt><dt><span class="section"><a href="#_applying_headers_to_health_check_requests">3.3.3. Applying Headers to Health Check Requests</a></span></dt></dl></dd><dt><span class="section"><a href="#_looking_up_services">3.4. Looking up services</a></span></dt><dd><dl><dt><span class="section"><a href="#_using_ribbon">3.4.1. Using Ribbon</a></span></dt><dt><span class="section"><a href="#_using_the_discoveryclient">3.4.2. Using the DiscoveryClient</a></span></dt></dl></dd><dt><span class="section"><a href="#_consul_catalog_watch">3.5. Consul Catalog Watch</a></span></dt></dl></dd><dt><span class="chapter"><a href="#spring-cloud-consul-config">4. Distributed Configuration with Consul</a></span></dt><dd><dl><dt><span class="section"><a href="#_how_to_activate_2">4.1. How to activate</a></span></dt><dt><span class="section"><a href="#_customizing">4.2. Customizing</a></span></dt><dt><span class="section"><a href="#spring-cloud-consul-config-watch">4.3. Config Watch</a></span></dt><dt><span class="section"><a href="#spring-cloud-consul-config-format">4.4. YAML or Properties with Config</a></span></dt><dt><span class="section"><a href="#spring-cloud-consul-config-git2consul">4.5. git2consul with Config</a></span></dt><dt><span class="section"><a href="#spring-cloud-consul-failfast">4.6. Fail Fast</a></span></dt></dl></dd><dt><span class="chapter"><a href="#spring-cloud-consul-retry">5. Consul Retry</a></span></dt><dt><span class="chapter"><a href="#spring-cloud-consul-bus">6. Spring Cloud Bus with Consul</a></span></dt><dd><dl><dt><span class="section"><a href="#_how_to_activate_3">6.1. How to activate</a></span></dt></dl></dd><dt><span class="chapter"><a href="#spring-cloud-consul-hystrix">7. Circuit Breaker with Hystrix</a></span></dt><dt><span class="chapter"><a href="#spring-cloud-consul-turbine">8. Hystrix metrics aggregation with Turbine and Consul</a></span></dt></dl></div><div class="preface"><div class="titlepage"><div><div><h1 class="title"><a name="d0e9" href="#d0e9"></a></h1></div></div></div><p><span class="strong"><strong>2.1.0.BUILD-SNAPSHOT</strong></span></p><p>This project provides Consul integrations for Spring Boot apps through autoconfiguration
<title>Spring Cloud Consul</title><link rel="stylesheet" type="text/css" href="css/manual-singlepage.css"><meta name="generator" content="DocBook XSL Stylesheets V1.79.1"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div lang="en" class="book"><div class="titlepage"><div><div><h1 class="title"><a name="d0e3"></a>Spring Cloud Consul</h1></div></div><hr></div><div class="toc"><p><b>Table of Contents</b></p><dl class="toc"><dt><span class="preface"><a href="#d0e9"></a></span></dt><dt><span class="chapter"><a href="#spring-cloud-consul-install">1. Install Consul</a></span></dt><dt><span class="chapter"><a href="#spring-cloud-consul-agent">2. Consul Agent</a></span></dt><dt><span class="chapter"><a href="#spring-cloud-consul-discovery">3. Service Discovery with Consul</a></span></dt><dd><dl><dt><span class="section"><a href="#_how_to_activate">3.1. How to activate</a></span></dt><dt><span class="section"><a href="#_registering_with_consul">3.2. Registering with Consul</a></span></dt><dt><span class="section"><a href="#_http_health_check">3.3. HTTP Health Check</a></span></dt><dd><dl><dt><span class="section"><a href="#_metadata_and_consul_tags">3.3.1. Metadata and Consul tags</a></span></dt><dt><span class="section"><a href="#_making_the_consul_instance_id_unique">3.3.2. Making the Consul Instance ID Unique</a></span></dt><dt><span class="section"><a href="#_applying_headers_to_health_check_requests">3.3.3. Applying Headers to Health Check Requests</a></span></dt></dl></dd><dt><span class="section"><a href="#_looking_up_services">3.4. Looking up services</a></span></dt><dd><dl><dt><span class="section"><a href="#_using_ribbon">3.4.1. Using Ribbon</a></span></dt><dt><span class="section"><a href="#_using_the_discoveryclient">3.4.2. Using the DiscoveryClient</a></span></dt></dl></dd><dt><span class="section"><a href="#_consul_catalog_watch">3.5. Consul Catalog Watch</a></span></dt></dl></dd><dt><span class="chapter"><a href="#spring-cloud-consul-config">4. Distributed Configuration with Consul</a></span></dt><dd><dl><dt><span class="section"><a href="#_how_to_activate_2">4.1. How to activate</a></span></dt><dt><span class="section"><a href="#_customizing">4.2. Customizing</a></span></dt><dt><span class="section"><a href="#spring-cloud-consul-config-watch">4.3. Config Watch</a></span></dt><dt><span class="section"><a href="#spring-cloud-consul-config-format">4.4. YAML or Properties with Config</a></span></dt><dt><span class="section"><a href="#spring-cloud-consul-config-git2consul">4.5. git2consul with Config</a></span></dt><dt><span class="section"><a href="#spring-cloud-consul-failfast">4.6. Fail Fast</a></span></dt></dl></dd><dt><span class="chapter"><a href="#spring-cloud-consul-retry">5. Consul Retry</a></span></dt><dt><span class="chapter"><a href="#spring-cloud-consul-bus">6. Spring Cloud Bus with Consul</a></span></dt><dd><dl><dt><span class="section"><a href="#_how_to_activate_3">6.1. How to activate</a></span></dt></dl></dd><dt><span class="chapter"><a href="#spring-cloud-consul-hystrix">7. Circuit Breaker with Hystrix</a></span></dt><dt><span class="chapter"><a href="#spring-cloud-consul-turbine">8. Hystrix metrics aggregation with Turbine and Consul</a></span></dt></dl></div><div class="preface"><div class="titlepage"><div><div><h1 class="title"><a name="d0e9" href="#d0e9"></a></h1></div></div></div><p><span class="strong"><strong>2.1.0.BUILD-SNAPSHOT</strong></span></p><p>This project provides Consul integrations for Spring Boot apps through autoconfiguration
and binding to the Spring Environment and other Spring programming model idioms. With a few
simple annotations you can quickly enable and configure the common patterns inside your
application and build large distributed systems with Consul based components. The

View File

@@ -4,7 +4,7 @@
<meta charset="UTF-8">
<!--[if IE]><meta http-equiv="X-UA-Compatible" content="IE=edge"><![endif]-->
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="generator" content="Asciidoctor 1.5.5">
<meta name="generator" content="Asciidoctor 1.5.7.1">
<title>spring-cloud-consul</title>
<link rel="stylesheet" href="css/manual-singlepage.css">
<style>