Sync docs from master to gh-pages
This commit is contained in:
@@ -95,23 +95,23 @@ $(addBlockSwitches);
|
||||
<div id="toc" class="toc2">
|
||||
<div id="toctitle">Table of Contents</div>
|
||||
<ul class="sectlevel1">
|
||||
<li><a href="#_zookeeper_overview">Zookeeper overview</a></li>
|
||||
<li><a href="#_spring_cloud_zookeeper_features">Spring Cloud Zookeeper Features</a></li>
|
||||
<li><a href="#_running_the_sample">Running the Sample</a></li>
|
||||
<li><a href="#_building">Building</a>
|
||||
<li><a href="#zookeeper-overview">1. Zookeeper overview</a></li>
|
||||
<li><a href="#spring-cloud-zookeeper-features">2. Spring Cloud Zookeeper Features</a></li>
|
||||
<li><a href="#running-the-sample">3. Running the Sample</a></li>
|
||||
<li><a href="#building">4. Building</a>
|
||||
<ul class="sectlevel2">
|
||||
<li><a href="#_basic_compile_and_test">Basic Compile and Test</a></li>
|
||||
<li><a href="#_documentation">Documentation</a></li>
|
||||
<li><a href="#_working_with_the_code">Working with the code</a></li>
|
||||
<li><a href="#basic-compile-and-test">4.1. Basic Compile and Test</a></li>
|
||||
<li><a href="#documentation">4.2. Documentation</a></li>
|
||||
<li><a href="#working-with-the-code">4.3. Working with the code</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li><a href="#_contributing">Contributing</a>
|
||||
<li><a href="#contributing">5. Contributing</a>
|
||||
<ul class="sectlevel2">
|
||||
<li><a href="#_sign_the_contributor_license_agreement">Sign the Contributor License Agreement</a></li>
|
||||
<li><a href="#_code_of_conduct">Code of Conduct</a></li>
|
||||
<li><a href="#_code_conventions_and_housekeeping">Code Conventions and Housekeeping</a></li>
|
||||
<li><a href="#_checkstyle">Checkstyle</a></li>
|
||||
<li><a href="#_ide_setup">IDE setup</a></li>
|
||||
<li><a href="#sign-the-contributor-license-agreement">5.1. Sign the Contributor License Agreement</a></li>
|
||||
<li><a href="#code-of-conduct">5.2. Code of Conduct</a></li>
|
||||
<li><a href="#code-conventions-and-housekeeping">5.3. Code Conventions and Housekeeping</a></li>
|
||||
<li><a href="#checkstyle">5.4. Checkstyle</a></li>
|
||||
<li><a href="#ide-setup">5.5. IDE setup</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
@@ -137,7 +137,7 @@ with Spring Cloud Netflix provides Intelligent Routing (Zuul), Client Side Load
|
||||
</div>
|
||||
</div>
|
||||
<div class="sect1">
|
||||
<h2 id="_zookeeper_overview"><a class="link" href="#_zookeeper_overview">Zookeeper overview</a></h2>
|
||||
<h2 id="zookeeper-overview"><a class="anchor" href="#zookeeper-overview"></a><a class="link" href="#zookeeper-overview">1. Zookeeper overview</a></h2>
|
||||
<div class="sectionbody">
|
||||
<div class="paragraph">
|
||||
<p>ZooKeeper is a centralized service for maintaining configuration information, naming,
|
||||
@@ -149,7 +149,7 @@ at Netflix.</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="sect1">
|
||||
<h2 id="_spring_cloud_zookeeper_features"><a class="link" href="#_spring_cloud_zookeeper_features">Spring Cloud Zookeeper Features</a></h2>
|
||||
<h2 id="spring-cloud-zookeeper-features"><a class="anchor" href="#spring-cloud-zookeeper-features"></a><a class="link" href="#spring-cloud-zookeeper-features">2. Spring Cloud Zookeeper Features</a></h2>
|
||||
<div class="sectionbody">
|
||||
<div class="paragraph">
|
||||
<p>Spring Cloud Zookeeper includes the following features:</p>
|
||||
@@ -167,7 +167,7 @@ at Netflix.</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="sect1">
|
||||
<h2 id="_running_the_sample"><a class="link" href="#_running_the_sample">Running the Sample</a></h2>
|
||||
<h2 id="running-the-sample"><a class="anchor" href="#running-the-sample"></a><a class="link" href="#running-the-sample">3. Running the Sample</a></h2>
|
||||
<div class="sectionbody">
|
||||
<div class="olist arabic">
|
||||
<ol class="arabic">
|
||||
@@ -191,23 +191,23 @@ Doing so brings in the required Spring Cloud Maven repositories and Build.</p>
|
||||
<p>Run <code>java -jar spring-cloud-zookeeper-sample/target/spring-cloud-zookeeper-sample-1.2.0.BUILD-SNAPSHOT.jar</code>.</p>
|
||||
</li>
|
||||
<li>
|
||||
<p>Visit <a href="http://localhost:8080" class="bare">http://localhost:8080</a> to verify that <code>{"serviceId":"testZookeeperApp","host":"<yourhost>","port":8080}</code> works.</p>
|
||||
<p>Visit <a href="http://localhost:8080" class="bare">localhost:8080</a> to verify that <code>{"serviceId":"testZookeeperApp","host":"<yourhost>","port":8080}</code> works.</p>
|
||||
</li>
|
||||
<li>
|
||||
<p>Run <code>java -jar spring-cloud-zookeeper-sample/target/spring-cloud-zookeeper-sample-1.2.0.BUILD-SNAPSHOT.jar --server.port=8081</code></p>
|
||||
</li>
|
||||
<li>
|
||||
<p>Visit <a href="http://localhost:8080" class="bare">http://localhost:8080</a> again to verify that <code>{"serviceId":"testZookeeperApp","host":"<yourhost>","port":8081}</code> eventually shows up in the results in a round-robin fashion. (It may take a minute or so.)</p>
|
||||
<p>Visit <a href="http://localhost:8080" class="bare">localhost:8080</a> again to verify that <code>{"serviceId":"testZookeeperApp","host":"<yourhost>","port":8081}</code> eventually shows up in the results in a round-robin fashion. (It may take a minute or so.)</p>
|
||||
</li>
|
||||
</ol>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="sect1">
|
||||
<h2 id="_building"><a class="link" href="#_building">Building</a></h2>
|
||||
<h2 id="building"><a class="anchor" href="#building"></a><a class="link" href="#building">4. Building</a></h2>
|
||||
<div class="sectionbody">
|
||||
<div class="sect2">
|
||||
<h3 id="_basic_compile_and_test"><a class="link" href="#_basic_compile_and_test">Basic Compile and Test</a></h3>
|
||||
<h3 id="basic-compile-and-test"><a class="anchor" href="#basic-compile-and-test"></a><a class="link" href="#basic-compile-and-test">4.1. Basic Compile and Test</a></h3>
|
||||
<div class="paragraph">
|
||||
<p>To build the source you will need to install JDK 1.7.</p>
|
||||
</div>
|
||||
@@ -285,7 +285,7 @@ If all else fails, build with the command from <code>.travis.yml</code> (usually
|
||||
</div>
|
||||
</div>
|
||||
<div class="sect2">
|
||||
<h3 id="_documentation"><a class="link" href="#_documentation">Documentation</a></h3>
|
||||
<h3 id="documentation"><a class="anchor" href="#documentation"></a><a class="link" href="#documentation">4.2. Documentation</a></h3>
|
||||
<div class="paragraph">
|
||||
<p>The spring-cloud-build module has a "docs" profile, and if you switch
|
||||
that on it will try to build asciidoc sources from
|
||||
@@ -298,7 +298,7 @@ a modified file in the correct place. Just commit it and push the change.</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="sect2">
|
||||
<h3 id="_working_with_the_code"><a class="link" href="#_working_with_the_code">Working with the code</a></h3>
|
||||
<h3 id="working-with-the-code"><a class="anchor" href="#working-with-the-code"></a><a class="link" href="#working-with-the-code">4.3. Working with the code</a></h3>
|
||||
<div class="paragraph">
|
||||
<p>If you don’t have an IDE preference we would recommend that you use
|
||||
<a href="https://www.springsource.com/developer/sts">Spring Tools Suite</a> or
|
||||
@@ -307,7 +307,7 @@ a modified file in the correct place. Just commit it and push the change.</p>
|
||||
should also work without issue as long as they use Maven 3.3.3 or better.</p>
|
||||
</div>
|
||||
<div class="sect3">
|
||||
<h4 id="_importing_into_eclipse_with_m2eclipse"><a class="link" href="#_importing_into_eclipse_with_m2eclipse">Importing into eclipse with m2eclipse</a></h4>
|
||||
<h4 id="importing-into-eclipse-with-m2eclipse"><a class="anchor" href="#importing-into-eclipse-with-m2eclipse"></a><a class="link" href="#importing-into-eclipse-with-m2eclipse">4.3.1. Importing into eclipse with m2eclipse</a></h4>
|
||||
<div class="paragraph">
|
||||
<p>We recommend the <a href="https://eclipse.org/m2e/">m2eclipse</a> eclipse plugin when working with
|
||||
eclipse. If you don’t already have m2eclipse installed it is available from the "eclipse
|
||||
@@ -334,7 +334,7 @@ pom into your <code>settings.xml</code>.
|
||||
</div>
|
||||
</div>
|
||||
<div class="sect3">
|
||||
<h4 id="_importing_into_eclipse_without_m2eclipse"><a class="link" href="#_importing_into_eclipse_without_m2eclipse">Importing into eclipse without m2eclipse</a></h4>
|
||||
<h4 id="importing-into-eclipse-without-m2eclipse"><a class="anchor" href="#importing-into-eclipse-without-m2eclipse"></a><a class="link" href="#importing-into-eclipse-without-m2eclipse">4.3.2. Importing into eclipse without m2eclipse</a></h4>
|
||||
<div class="paragraph">
|
||||
<p>If you prefer not to use m2eclipse you can generate eclipse project metadata using the
|
||||
following command:</p>
|
||||
@@ -353,7 +353,7 @@ from the <code>file</code> menu.</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="sect1">
|
||||
<h2 id="_contributing"><a class="link" href="#_contributing">Contributing</a></h2>
|
||||
<h2 id="contributing"><a class="anchor" href="#contributing"></a><a class="link" href="#contributing">5. Contributing</a></h2>
|
||||
<div class="sectionbody">
|
||||
<div class="paragraph">
|
||||
<p>Spring Cloud is released under the non-restrictive Apache 2.0 license,
|
||||
@@ -363,7 +363,7 @@ to contribute even something trivial please do not hesitate, but
|
||||
follow the guidelines below.</p>
|
||||
</div>
|
||||
<div class="sect2">
|
||||
<h3 id="_sign_the_contributor_license_agreement"><a class="link" href="#_sign_the_contributor_license_agreement">Sign the Contributor License Agreement</a></h3>
|
||||
<h3 id="sign-the-contributor-license-agreement"><a class="anchor" href="#sign-the-contributor-license-agreement"></a><a class="link" href="#sign-the-contributor-license-agreement">5.1. Sign the Contributor License Agreement</a></h3>
|
||||
<div class="paragraph">
|
||||
<p>Before we accept a non-trivial patch or pull request we will need you to sign the
|
||||
<a href="https://cla.pivotal.io/sign/spring">Contributor License Agreement</a>.
|
||||
@@ -374,7 +374,7 @@ given the ability to merge pull requests.</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="sect2">
|
||||
<h3 id="_code_of_conduct"><a class="link" href="#_code_of_conduct">Code of Conduct</a></h3>
|
||||
<h3 id="code-of-conduct"><a class="anchor" href="#code-of-conduct"></a><a class="link" href="#code-of-conduct">5.2. Code of Conduct</a></h3>
|
||||
<div class="paragraph">
|
||||
<p>This project adheres to the Contributor Covenant <a href="https://github.com/spring-cloud/spring-cloud-build/blob/master/docs/src/main/asciidoc/code-of-conduct.adoc">code of
|
||||
conduct</a>. By participating, you are expected to uphold this code. Please report
|
||||
@@ -382,7 +382,7 @@ unacceptable behavior to <a href="mailto:spring-code-of-conduct@pivotal.io">spri
|
||||
</div>
|
||||
</div>
|
||||
<div class="sect2">
|
||||
<h3 id="_code_conventions_and_housekeeping"><a class="link" href="#_code_conventions_and_housekeeping">Code Conventions and Housekeeping</a></h3>
|
||||
<h3 id="code-conventions-and-housekeeping"><a class="anchor" href="#code-conventions-and-housekeeping"></a><a class="link" href="#code-conventions-and-housekeeping">5.3. Code Conventions and Housekeeping</a></h3>
|
||||
<div class="paragraph">
|
||||
<p>None of these is essential for a pull request, but they will all help. They can also be
|
||||
added after the original pull request but before a merge.</p>
|
||||
@@ -430,7 +430,7 @@ message (where XXXX is the issue number).</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="sect2">
|
||||
<h3 id="_checkstyle"><a class="link" href="#_checkstyle">Checkstyle</a></h3>
|
||||
<h3 id="checkstyle"><a class="anchor" href="#checkstyle"></a><a class="link" href="#checkstyle">5.4. Checkstyle</a></h3>
|
||||
<div class="paragraph">
|
||||
<p>Spring Cloud Build comes with a set of checkstyle rules. You can find them in the <code>spring-cloud-build-tools</code> module. The most notable files under the module are:</p>
|
||||
</div>
|
||||
@@ -463,7 +463,7 @@ message (where XXXX is the issue number).</p>
|
||||
</table>
|
||||
</div>
|
||||
<div class="sect3">
|
||||
<h4 id="_checkstyle_configuration"><a class="link" href="#_checkstyle_configuration">Checkstyle configuration</a></h4>
|
||||
<h4 id="checkstyle-configuration"><a class="anchor" href="#checkstyle-configuration"></a><a class="link" href="#checkstyle-configuration">5.4.1. Checkstyle configuration</a></h4>
|
||||
<div class="paragraph">
|
||||
<p>Checkstyle rules are <strong>disabled by default</strong>. To add checkstyle to your project just define the following properties and plugins.</p>
|
||||
</div>
|
||||
@@ -533,11 +533,11 @@ message (where XXXX is the issue number).</p>
|
||||
<div class="content">
|
||||
<pre><?xml version="1.0"?>
|
||||
<!DOCTYPE suppressions PUBLIC
|
||||
"-//Puppy Crawl//DTD Suppressions 1.1//EN"
|
||||
"https://www.puppycrawl.com/dtds/suppressions_1_1.dtd">
|
||||
"-//Puppy Crawl//DTD Suppressions 1.1//EN"
|
||||
"https://www.puppycrawl.com/dtds/suppressions_1_1.dtd">
|
||||
<suppressions>
|
||||
<suppress files=".*ConfigServerApplication\.java" checks="HideUtilityClassConstructor"/>
|
||||
<suppress files=".*ConfigClientWatch\.java" checks="LineLengthCheck"/>
|
||||
<suppress files=".*ConfigServerApplication\.java" checks="HideUtilityClassConstructor"/>
|
||||
<suppress files=".*ConfigClientWatch\.java" checks="LineLengthCheck"/>
|
||||
</suppressions></pre>
|
||||
</div>
|
||||
</div>
|
||||
@@ -553,9 +553,9 @@ $ touch .springformat</code></pre>
|
||||
</div>
|
||||
</div>
|
||||
<div class="sect2">
|
||||
<h3 id="_ide_setup"><a class="link" href="#_ide_setup">IDE setup</a></h3>
|
||||
<h3 id="ide-setup"><a class="anchor" href="#ide-setup"></a><a class="link" href="#ide-setup">5.5. IDE setup</a></h3>
|
||||
<div class="sect3">
|
||||
<h4 id="_intellij_idea"><a class="link" href="#_intellij_idea">Intellij IDEA</a></h4>
|
||||
<h4 id="intellij-idea"><a class="anchor" href="#intellij-idea"></a><a class="link" href="#intellij-idea">5.5.1. Intellij IDEA</a></h4>
|
||||
<div class="paragraph">
|
||||
<p>In order to setup Intellij you should import our coding conventions, inspection profiles and set up the checkstyle plugin.
|
||||
The following files can be found in the <a href="https://github.com/spring-cloud/spring-cloud-build/tree/master/spring-cloud-build-tools">Spring Cloud Build</a> project.</p>
|
||||
@@ -627,15 +627,15 @@ The following files can be found in the <a href="https://github.com/spring-cloud
|
||||
</div>
|
||||
</div>
|
||||
<div class="paragraph">
|
||||
<p>Go to <code>File</code> → <code>Settings</code> → <code>Other settings</code> → <code>Checkstyle</code>. There click on the <code>+</code> icon in the <code>Configuration file</code> section. There, you’ll have to define where the checkstyle rules should be picked from. In the image above, we’ve picked the rules from the cloned Spring Cloud Build repository. However, you can point to the Spring Cloud Build’s GitHub repository (e.g. for the <code>checkstyle.xml</code> : <code><a href="https://raw.githubusercontent.com/spring-cloud/spring-cloud-build/master/spring-cloud-build-tools/src/main/resources/checkstyle.xml" class="bare">https://raw.githubusercontent.com/spring-cloud/spring-cloud-build/master/spring-cloud-build-tools/src/main/resources/checkstyle.xml</a></code>). We need to provide the following variables:</p>
|
||||
<p>Go to <code>File</code> → <code>Settings</code> → <code>Other settings</code> → <code>Checkstyle</code>. There click on the <code>+</code> icon in the <code>Configuration file</code> section. There, you’ll have to define where the checkstyle rules should be picked from. In the image above, we’ve picked the rules from the cloned Spring Cloud Build repository. However, you can point to the Spring Cloud Build’s GitHub repository (e.g. for the <code>checkstyle.xml</code> : <code><a href="https://raw.githubusercontent.com/spring-cloud/spring-cloud-build/master/spring-cloud-build-tools/src/main/resources/checkstyle.xml" class="bare">raw.githubusercontent.com/spring-cloud/spring-cloud-build/master/spring-cloud-build-tools/src/main/resources/checkstyle.xml</a></code>). We need to provide the following variables:</p>
|
||||
</div>
|
||||
<div class="ulist">
|
||||
<ul>
|
||||
<li>
|
||||
<p><code>checkstyle.header.file</code> - please point it to the Spring Cloud Build’s, <code>spring-cloud-build-tools/src/main/resources/checkstyle-header.txt</code> file either in your cloned repo or via the <code><a href="https://raw.githubusercontent.com/spring-cloud/spring-cloud-build/master/spring-cloud-build-tools/src/main/resources/checkstyle-header.txt" class="bare">https://raw.githubusercontent.com/spring-cloud/spring-cloud-build/master/spring-cloud-build-tools/src/main/resources/checkstyle-header.txt</a></code> URL.</p>
|
||||
<p><code>checkstyle.header.file</code> - please point it to the Spring Cloud Build’s, <code>spring-cloud-build-tools/src/main/resources/checkstyle-header.txt</code> file either in your cloned repo or via the <code><a href="https://raw.githubusercontent.com/spring-cloud/spring-cloud-build/master/spring-cloud-build-tools/src/main/resources/checkstyle-header.txt" class="bare">raw.githubusercontent.com/spring-cloud/spring-cloud-build/master/spring-cloud-build-tools/src/main/resources/checkstyle-header.txt</a></code> URL.</p>
|
||||
</li>
|
||||
<li>
|
||||
<p><code>checkstyle.suppressions.file</code> - default suppressions. Please point it to the Spring Cloud Build’s, <code>spring-cloud-build-tools/src/checkstyle/checkstyle-suppressions.xml</code> file either in your cloned repo or via the <code><a href="https://raw.githubusercontent.com/spring-cloud/spring-cloud-build/master/spring-cloud-build-tools/src/checkstyle/checkstyle-suppressions.xml" class="bare">https://raw.githubusercontent.com/spring-cloud/spring-cloud-build/master/spring-cloud-build-tools/src/checkstyle/checkstyle-suppressions.xml</a></code> URL.</p>
|
||||
<p><code>checkstyle.suppressions.file</code> - default suppressions. Please point it to the Spring Cloud Build’s, <code>spring-cloud-build-tools/src/checkstyle/checkstyle-suppressions.xml</code> file either in your cloned repo or via the <code><a href="https://raw.githubusercontent.com/spring-cloud/spring-cloud-build/master/spring-cloud-build-tools/src/checkstyle/checkstyle-suppressions.xml" class="bare">raw.githubusercontent.com/spring-cloud/spring-cloud-build/master/spring-cloud-build-tools/src/checkstyle/checkstyle-suppressions.xml</a></code> URL.</p>
|
||||
</li>
|
||||
<li>
|
||||
<p><code>checkstyle.additional.suppressions.file</code> - this variable corresponds to suppressions in your local project. E.g. you’re working on <code>spring-cloud-contract</code>. Then point to the <code>project-root/src/checkstyle/checkstyle-suppressions.xml</code> folder. Example for <code>spring-cloud-contract</code> would be: <code>/home/username/spring-cloud-contract/src/checkstyle/checkstyle-suppressions.xml</code>.</p>
|
||||
|
||||
263
reference/html/appendix.html
Normal file
263
reference/html/appendix.html
Normal file
@@ -0,0 +1,263 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<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.7.1">
|
||||
<title>Common application properties</title>
|
||||
<link rel="stylesheet" href="css/spring.css">
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
|
||||
|
||||
<style>
|
||||
.hidden {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.switch {
|
||||
border-width: 1px 1px 0 1px;
|
||||
border-style: solid;
|
||||
border-color: #7a2518;
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
.switch--item {
|
||||
padding: 10px;
|
||||
background-color: #ffffff;
|
||||
color: #7a2518;
|
||||
display: inline-block;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.switch--item:not(:first-child) {
|
||||
border-width: 0 0 0 1px;
|
||||
border-style: solid;
|
||||
border-color: #7a2518;
|
||||
}
|
||||
|
||||
.switch--item.selected {
|
||||
background-color: #7a2519;
|
||||
color: #ffffff;
|
||||
}
|
||||
</style>
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/zepto/1.2.0/zepto.min.js"></script>
|
||||
<script type="text/javascript">
|
||||
function addBlockSwitches() {
|
||||
$('.primary').each(function() {
|
||||
primary = $(this);
|
||||
createSwitchItem(primary, createBlockSwitch(primary)).item.addClass("selected");
|
||||
primary.children('.title').remove();
|
||||
});
|
||||
$('.secondary').each(function(idx, node) {
|
||||
secondary = $(node);
|
||||
primary = findPrimary(secondary);
|
||||
switchItem = createSwitchItem(secondary, primary.children('.switch'));
|
||||
switchItem.content.addClass('hidden');
|
||||
findPrimary(secondary).append(switchItem.content);
|
||||
secondary.remove();
|
||||
});
|
||||
}
|
||||
|
||||
function createBlockSwitch(primary) {
|
||||
blockSwitch = $('<div class="switch"></div>');
|
||||
primary.prepend(blockSwitch);
|
||||
return blockSwitch;
|
||||
}
|
||||
|
||||
function findPrimary(secondary) {
|
||||
candidate = secondary.prev();
|
||||
while (!candidate.is('.primary')) {
|
||||
candidate = candidate.prev();
|
||||
}
|
||||
return candidate;
|
||||
}
|
||||
|
||||
function createSwitchItem(block, blockSwitch) {
|
||||
blockName = block.children('.title').text();
|
||||
content = block.children('.content').first().append(block.next('.colist'));
|
||||
item = $('<div class="switch--item">' + blockName + '</div>');
|
||||
item.on('click', '', content, function(e) {
|
||||
$(this).addClass('selected');
|
||||
$(this).siblings().removeClass('selected');
|
||||
e.data.siblings('.content').addClass('hidden');
|
||||
e.data.removeClass('hidden');
|
||||
});
|
||||
blockSwitch.append(item);
|
||||
return {'item': item, 'content': content};
|
||||
}
|
||||
|
||||
$(addBlockSwitches);
|
||||
</script>
|
||||
|
||||
</head>
|
||||
<body class="book toc2 toc-left">
|
||||
<div id="header">
|
||||
<div id="toc" class="toc2">
|
||||
<div id="toctitle">Table of Contents</div>
|
||||
<ul class="sectlevel1">
|
||||
<li><a href="#common-application-properties">Appendix A: Common application properties</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div id="content">
|
||||
<div class="sect1">
|
||||
<h2 id="common-application-properties"><a class="link" href="#common-application-properties">Appendix A: Common application properties</a></h2>
|
||||
<div class="sectionbody">
|
||||
<div class="paragraph">
|
||||
<p>Various properties can be specified inside your <code>application.properties</code> file, inside your <code>application.yml</code> file, or as command line switches.
|
||||
This appendix provides a list of common Spring Cloud Zookeeper properties and references to the underlying classes that consume them.</p>
|
||||
</div>
|
||||
<div class="admonitionblock note">
|
||||
<table>
|
||||
<tr>
|
||||
<td class="icon">
|
||||
<i class="fa icon-note" title="Note"></i>
|
||||
</td>
|
||||
<td class="content">
|
||||
Property contributions can come from additional jar files on your classpath, so you should not consider this an exhaustive list.
|
||||
Also, you can define your own properties.
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
<table class="tableblock frame-all grid-all stretch">
|
||||
<colgroup>
|
||||
<col style="width: 33.3333%;">
|
||||
<col style="width: 33.3333%;">
|
||||
<col style="width: 33.3334%;">
|
||||
</colgroup>
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="tableblock halign-left valign-top">Name</th>
|
||||
<th class="tableblock halign-left valign-top">Default</th>
|
||||
<th class="tableblock halign-left valign-top">Description</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td class="tableblock halign-left valign-top"><p class="tableblock">spring.cloud.zookeeper.base-sleep-time-ms</p></td>
|
||||
<td class="tableblock halign-left valign-top"><p class="tableblock">50</p></td>
|
||||
<td class="tableblock halign-left valign-top"><p class="tableblock">Initial amount of time to wait between retries.</p></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="tableblock halign-left valign-top"><p class="tableblock">spring.cloud.zookeeper.block-until-connected-unit</p></td>
|
||||
<td class="tableblock halign-left valign-top"></td>
|
||||
<td class="tableblock halign-left valign-top"><p class="tableblock">The unit of time related to blocking on connection to Zookeeper.</p></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="tableblock halign-left valign-top"><p class="tableblock">spring.cloud.zookeeper.block-until-connected-wait</p></td>
|
||||
<td class="tableblock halign-left valign-top"><p class="tableblock">10</p></td>
|
||||
<td class="tableblock halign-left valign-top"><p class="tableblock">Wait time to block on connection to Zookeeper.</p></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="tableblock halign-left valign-top"><p class="tableblock">spring.cloud.zookeeper.connect-string</p></td>
|
||||
<td class="tableblock halign-left valign-top"><p class="tableblock">localhost:2181</p></td>
|
||||
<td class="tableblock halign-left valign-top"><p class="tableblock">Connection string to the Zookeeper cluster.</p></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="tableblock halign-left valign-top"><p class="tableblock">spring.cloud.zookeeper.default-health-endpoint</p></td>
|
||||
<td class="tableblock halign-left valign-top"></td>
|
||||
<td class="tableblock halign-left valign-top"><p class="tableblock">Default health endpoint that will be checked to verify that a dependency is alive.</p></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="tableblock halign-left valign-top"><p class="tableblock">spring.cloud.zookeeper.dependencies</p></td>
|
||||
<td class="tableblock halign-left valign-top"></td>
|
||||
<td class="tableblock halign-left valign-top"><p class="tableblock">Mapping of alias to ZookeeperDependency. From Ribbon perspective the alias is actually serviceID since Ribbon can’t accept nested structures in serviceID.</p></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="tableblock halign-left valign-top"><p class="tableblock">spring.cloud.zookeeper.dependency-configurations</p></td>
|
||||
<td class="tableblock halign-left valign-top"></td>
|
||||
<td class="tableblock halign-left valign-top"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="tableblock halign-left valign-top"><p class="tableblock">spring.cloud.zookeeper.dependency-names</p></td>
|
||||
<td class="tableblock halign-left valign-top"></td>
|
||||
<td class="tableblock halign-left valign-top"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="tableblock halign-left valign-top"><p class="tableblock">spring.cloud.zookeeper.discovery.enabled</p></td>
|
||||
<td class="tableblock halign-left valign-top"><p class="tableblock">true</p></td>
|
||||
<td class="tableblock halign-left valign-top"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="tableblock halign-left valign-top"><p class="tableblock">spring.cloud.zookeeper.discovery.initial-status</p></td>
|
||||
<td class="tableblock halign-left valign-top"></td>
|
||||
<td class="tableblock halign-left valign-top"><p class="tableblock">The initial status of this instance (defaults to {@link StatusConstants#STATUS_UP}).</p></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="tableblock halign-left valign-top"><p class="tableblock">spring.cloud.zookeeper.discovery.instance-host</p></td>
|
||||
<td class="tableblock halign-left valign-top"></td>
|
||||
<td class="tableblock halign-left valign-top"><p class="tableblock">Predefined host with which a service can register itself in Zookeeper. Corresponds to the {code address} from the URI spec.</p></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="tableblock halign-left valign-top"><p class="tableblock">spring.cloud.zookeeper.discovery.instance-id</p></td>
|
||||
<td class="tableblock halign-left valign-top"></td>
|
||||
<td class="tableblock halign-left valign-top"><p class="tableblock">Id used to register with zookeeper. Defaults to a random UUID.</p></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="tableblock halign-left valign-top"><p class="tableblock">spring.cloud.zookeeper.discovery.instance-port</p></td>
|
||||
<td class="tableblock halign-left valign-top"></td>
|
||||
<td class="tableblock halign-left valign-top"><p class="tableblock">Port to register the service under (defaults to listening port).</p></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="tableblock halign-left valign-top"><p class="tableblock">spring.cloud.zookeeper.discovery.instance-ssl-port</p></td>
|
||||
<td class="tableblock halign-left valign-top"></td>
|
||||
<td class="tableblock halign-left valign-top"><p class="tableblock">Ssl port of the registered service.</p></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="tableblock halign-left valign-top"><p class="tableblock">spring.cloud.zookeeper.discovery.metadata</p></td>
|
||||
<td class="tableblock halign-left valign-top"></td>
|
||||
<td class="tableblock halign-left valign-top"><p class="tableblock">Gets the metadata name/value pairs associated with this instance. This information is sent to zookeeper and can be used by other instances.</p></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="tableblock halign-left valign-top"><p class="tableblock">spring.cloud.zookeeper.discovery.order</p></td>
|
||||
<td class="tableblock halign-left valign-top"><p class="tableblock">0</p></td>
|
||||
<td class="tableblock halign-left valign-top"><p class="tableblock">Order of the discovery client used by <code>CompositeDiscoveryClient</code> for sorting available clients.</p></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="tableblock halign-left valign-top"><p class="tableblock">spring.cloud.zookeeper.discovery.register</p></td>
|
||||
<td class="tableblock halign-left valign-top"><p class="tableblock">true</p></td>
|
||||
<td class="tableblock halign-left valign-top"><p class="tableblock">Register as a service in zookeeper.</p></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="tableblock halign-left valign-top"><p class="tableblock">spring.cloud.zookeeper.discovery.root</p></td>
|
||||
<td class="tableblock halign-left valign-top"><p class="tableblock">/services</p></td>
|
||||
<td class="tableblock halign-left valign-top"><p class="tableblock">Root Zookeeper folder in which all instances are registered.</p></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="tableblock halign-left valign-top"><p class="tableblock">spring.cloud.zookeeper.discovery.uri-spec</p></td>
|
||||
<td class="tableblock halign-left valign-top"><p class="tableblock">{scheme}://{address}:{port}</p></td>
|
||||
<td class="tableblock halign-left valign-top"><p class="tableblock">The URI specification to resolve during service registration in Zookeeper.</p></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="tableblock halign-left valign-top"><p class="tableblock">spring.cloud.zookeeper.enabled</p></td>
|
||||
<td class="tableblock halign-left valign-top"><p class="tableblock">true</p></td>
|
||||
<td class="tableblock halign-left valign-top"><p class="tableblock">Is Zookeeper enabled.</p></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="tableblock halign-left valign-top"><p class="tableblock">spring.cloud.zookeeper.max-retries</p></td>
|
||||
<td class="tableblock halign-left valign-top"><p class="tableblock">10</p></td>
|
||||
<td class="tableblock halign-left valign-top"><p class="tableblock">Max number of times to retry.</p></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="tableblock halign-left valign-top"><p class="tableblock">spring.cloud.zookeeper.max-sleep-ms</p></td>
|
||||
<td class="tableblock halign-left valign-top"><p class="tableblock">500</p></td>
|
||||
<td class="tableblock halign-left valign-top"><p class="tableblock">Max time in ms to sleep on each retry.</p></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="tableblock halign-left valign-top"><p class="tableblock">spring.cloud.zookeeper.prefix</p></td>
|
||||
<td class="tableblock halign-left valign-top"></td>
|
||||
<td class="tableblock halign-left valign-top"><p class="tableblock">Common prefix that will be applied to all Zookeeper dependencies' paths.</p></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script type="text/javascript" src="js/tocbot/tocbot.min.js"></script>
|
||||
<script type="text/javascript" src="js/toc.js"></script>
|
||||
<link rel="stylesheet" href="js/highlight/styles/atom-one-dark-reasonable.min.css">
|
||||
<script src="js/highlight/highlight.min.js"></script>
|
||||
<script>hljs.initHighlighting()</script>
|
||||
</body>
|
||||
</html>
|
||||
@@ -96,44 +96,44 @@ $(addBlockSwitches);
|
||||
<div id="toc" class="toc2">
|
||||
<div id="toctitle">Table of Contents</div>
|
||||
<ul class="sectlevel1">
|
||||
<li><a href="#spring-cloud-zookeeper-install">Install Zookeeper</a></li>
|
||||
<li><a href="#spring-cloud-zookeeper-discovery">Service Discovery with Zookeeper</a>
|
||||
<li><a href="#spring-cloud-zookeeper-install">1. Install Zookeeper</a></li>
|
||||
<li><a href="#spring-cloud-zookeeper-discovery">2. Service Discovery with Zookeeper</a>
|
||||
<ul class="sectlevel2">
|
||||
<li><a href="#_activating">Activating</a></li>
|
||||
<li><a href="#_registering_with_zookeeper">Registering with Zookeeper</a></li>
|
||||
<li><a href="#_using_the_discoveryclient">Using the DiscoveryClient</a></li>
|
||||
<li><a href="#activating">2.1. Activating</a></li>
|
||||
<li><a href="#registering-with-zookeeper">2.2. Registering with Zookeeper</a></li>
|
||||
<li><a href="#using-the-discoveryclient">2.3. Using the DiscoveryClient</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li><a href="#spring-cloud-zookeeper-netflix">Using Spring Cloud Zookeeper with Spring Cloud Netflix Components</a>
|
||||
<li><a href="#spring-cloud-zookeeper-netflix">3. Using Spring Cloud Zookeeper with Spring Cloud Netflix Components</a>
|
||||
<ul class="sectlevel2">
|
||||
<li><a href="#_ribbon_with_zookeeper">Ribbon with Zookeeper</a></li>
|
||||
<li><a href="#ribbon-with-zookeeper">3.1. Ribbon with Zookeeper</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li><a href="#spring-cloud-zookeeper-service-registry">Spring Cloud Zookeeper and Service Registry</a>
|
||||
<li><a href="#spring-cloud-zookeeper-service-registry">4. Spring Cloud Zookeeper and Service Registry</a>
|
||||
<ul class="sectlevel2">
|
||||
<li><a href="#_instance_status">Instance Status</a></li>
|
||||
<li><a href="#instance-status">4.1. Instance Status</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li><a href="#spring-cloud-zookeeper-dependencies">Zookeeper Dependencies</a>
|
||||
<li><a href="#spring-cloud-zookeeper-dependencies">5. Zookeeper Dependencies</a>
|
||||
<ul class="sectlevel2">
|
||||
<li><a href="#spring-cloud-zookeeper-dependencies-using">Using the Zookeeper Dependencies</a></li>
|
||||
<li><a href="#spring-cloud-zookeeper-dependencies-activating">Activating Zookeeper Dependencies</a></li>
|
||||
<li><a href="#spring-cloud-zookeeper-dependencies-setting-up">Setting up Zookeeper Dependencies</a></li>
|
||||
<li><a href="#spring-cloud-zookeeper-dependencies-configuring">Configuring Spring Cloud Zookeeper Dependencies</a></li>
|
||||
<li><a href="#spring-cloud-zookeeper-dependencies-using">5.1. Using the Zookeeper Dependencies</a></li>
|
||||
<li><a href="#spring-cloud-zookeeper-dependencies-activating">5.2. Activating Zookeeper Dependencies</a></li>
|
||||
<li><a href="#spring-cloud-zookeeper-dependencies-setting-up">5.3. Setting up Zookeeper Dependencies</a></li>
|
||||
<li><a href="#spring-cloud-zookeeper-dependencies-configuring">5.4. Configuring Spring Cloud Zookeeper Dependencies</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li><a href="#spring-cloud-zookeeper-dependency-watcher">Spring Cloud Zookeeper Dependency Watcher</a>
|
||||
<li><a href="#spring-cloud-zookeeper-dependency-watcher">6. Spring Cloud Zookeeper Dependency Watcher</a>
|
||||
<ul class="sectlevel2">
|
||||
<li><a href="#_activating_2">Activating</a></li>
|
||||
<li><a href="#_registering_a_listener">Registering a Listener</a></li>
|
||||
<li><a href="#spring-cloud-zookeeper-dependency-watcher-presence-checker">Using the Presence Checker</a></li>
|
||||
<li><a href="#activating-2">6.1. Activating</a></li>
|
||||
<li><a href="#registering-a-listener">6.2. Registering a Listener</a></li>
|
||||
<li><a href="#spring-cloud-zookeeper-dependency-watcher-presence-checker">6.3. Using the Presence Checker</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li><a href="#spring-cloud-zookeeper-config">Distributed Configuration with Zookeeper</a>
|
||||
<li><a href="#spring-cloud-zookeeper-config">7. Distributed Configuration with Zookeeper</a>
|
||||
<ul class="sectlevel2">
|
||||
<li><a href="#_activating_3">Activating</a></li>
|
||||
<li><a href="#_customizing">Customizing</a></li>
|
||||
<li><a href="#_access_control_lists_acls">Access Control Lists (ACLs)</a></li>
|
||||
<li><a href="#activating-3">7.1. Activating</a></li>
|
||||
<li><a href="#customizing">7.2. Customizing</a></li>
|
||||
<li><a href="#access-control-lists-acls">7.3. Access Control Lists (ACLs)</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
@@ -154,7 +154,7 @@ with Spring Cloud Netflix provides Intelligent Routing (Zuul), Client Side Load
|
||||
</div>
|
||||
</div>
|
||||
<div class="sect1">
|
||||
<h2 id="spring-cloud-zookeeper-install"><a class="link" href="#spring-cloud-zookeeper-install">Install Zookeeper</a></h2>
|
||||
<h2 id="spring-cloud-zookeeper-install"><a class="anchor" href="#spring-cloud-zookeeper-install"></a><a class="link" href="#spring-cloud-zookeeper-install">1. Install Zookeeper</a></h2>
|
||||
<div class="sectionbody">
|
||||
<div class="paragraph">
|
||||
<p>See the <a href="https://zookeeper.apache.org/doc/current/zookeeperStarted.html">installation
|
||||
@@ -213,7 +213,7 @@ compile('org.apache.zookeeper:zookeeper:3.4.12') {
|
||||
</div>
|
||||
</div>
|
||||
<div class="sect1">
|
||||
<h2 id="spring-cloud-zookeeper-discovery"><a class="link" href="#spring-cloud-zookeeper-discovery">Service Discovery with Zookeeper</a></h2>
|
||||
<h2 id="spring-cloud-zookeeper-discovery"><a class="anchor" href="#spring-cloud-zookeeper-discovery"></a><a class="link" href="#spring-cloud-zookeeper-discovery">2. Service Discovery with Zookeeper</a></h2>
|
||||
<div class="sectionbody">
|
||||
<div class="paragraph">
|
||||
<p>Service Discovery is one of the key tenets of a microservice based architecture. Trying to
|
||||
@@ -224,7 +224,7 @@ Extension</a>. Spring Cloud Zookeeper uses this extension for service registrati
|
||||
discovery.</p>
|
||||
</div>
|
||||
<div class="sect2">
|
||||
<h3 id="_activating"><a class="link" href="#_activating">Activating</a></h3>
|
||||
<h3 id="activating"><a class="anchor" href="#activating"></a><a class="link" href="#activating">2.1. Activating</a></h3>
|
||||
<div class="paragraph">
|
||||
<p>Including a dependency on
|
||||
<code>org.springframework.cloud:spring-cloud-starter-zookeeper-discovery</code> enables
|
||||
@@ -258,7 +258,7 @@ the way you include the dependency as described <a href="#spring-cloud-zookeeper
|
||||
</div>
|
||||
</div>
|
||||
<div class="sect2">
|
||||
<h3 id="_registering_with_zookeeper"><a class="link" href="#_registering_with_zookeeper">Registering with Zookeeper</a></h3>
|
||||
<h3 id="registering-with-zookeeper"><a class="anchor" href="#registering-with-zookeeper"></a><a class="link" href="#registering-with-zookeeper">2.2. Registering with Zookeeper</a></h3>
|
||||
<div class="paragraph">
|
||||
<p>When a client registers with Zookeeper, it provides metadata (such as host and port, ID,
|
||||
and name) about itself.</p>
|
||||
@@ -338,7 +338,7 @@ query Zookeeper to locate other services).</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="sect2">
|
||||
<h3 id="_using_the_discoveryclient"><a class="link" href="#_using_the_discoveryclient">Using the DiscoveryClient</a></h3>
|
||||
<h3 id="using-the-discoveryclient"><a class="anchor" href="#using-the-discoveryclient"></a><a class="link" href="#using-the-discoveryclient">2.3. Using the DiscoveryClient</a></h3>
|
||||
<div class="paragraph">
|
||||
<p>Spring Cloud has support for
|
||||
<a href="https://github.com/spring-cloud/spring-cloud-netflix/blob/master/docs/src/main/asciidoc/spring-cloud-netflix.adoc#spring-cloud-feign">Feign</a>
|
||||
@@ -370,7 +370,7 @@ public String serviceUrl() {
|
||||
</div>
|
||||
</div>
|
||||
<div class="sect1">
|
||||
<h2 id="spring-cloud-zookeeper-netflix"><a class="link" href="#spring-cloud-zookeeper-netflix">Using Spring Cloud Zookeeper with Spring Cloud Netflix Components</a></h2>
|
||||
<h2 id="spring-cloud-zookeeper-netflix"><a class="anchor" href="#spring-cloud-zookeeper-netflix"></a><a class="link" href="#spring-cloud-zookeeper-netflix">3. Using Spring Cloud Zookeeper with Spring Cloud Netflix Components</a></h2>
|
||||
<div class="sectionbody">
|
||||
<div class="paragraph">
|
||||
<p>Spring Cloud Netflix supplies useful tools that work regardless of which <code>DiscoveryClient</code>
|
||||
@@ -378,7 +378,7 @@ implementation you use. Feign, Turbine, Ribbon, and Zuul all work with Spring Cl
|
||||
Zookeeper.</p>
|
||||
</div>
|
||||
<div class="sect2">
|
||||
<h3 id="_ribbon_with_zookeeper"><a class="link" href="#_ribbon_with_zookeeper">Ribbon with Zookeeper</a></h3>
|
||||
<h3 id="ribbon-with-zookeeper"><a class="anchor" href="#ribbon-with-zookeeper"></a><a class="link" href="#ribbon-with-zookeeper">3.1. Ribbon with Zookeeper</a></h3>
|
||||
<div class="paragraph">
|
||||
<p>Spring Cloud Zookeeper provides an implementation of Ribbon’s <code>ServerList</code>. When you use
|
||||
the <code>spring-cloud-starter-zookeeper-discovery</code>, Ribbon is autoconfigured to use the
|
||||
@@ -388,7 +388,7 @@ the <code>spring-cloud-starter-zookeeper-discovery</code>, Ribbon is autoconfig
|
||||
</div>
|
||||
</div>
|
||||
<div class="sect1">
|
||||
<h2 id="spring-cloud-zookeeper-service-registry"><a class="link" href="#spring-cloud-zookeeper-service-registry">Spring Cloud Zookeeper and Service Registry</a></h2>
|
||||
<h2 id="spring-cloud-zookeeper-service-registry"><a class="anchor" href="#spring-cloud-zookeeper-service-registry"></a><a class="link" href="#spring-cloud-zookeeper-service-registry">4. Spring Cloud Zookeeper and Service Registry</a></h2>
|
||||
<div class="sectionbody">
|
||||
<div class="paragraph">
|
||||
<p>Spring Cloud Zookeeper implements the <code>ServiceRegistry</code> interface, letting developers
|
||||
@@ -416,7 +416,7 @@ public void registerThings() {
|
||||
</div>
|
||||
</div>
|
||||
<div class="sect2">
|
||||
<h3 id="_instance_status"><a class="link" href="#_instance_status">Instance Status</a></h3>
|
||||
<h3 id="instance-status"><a class="anchor" href="#instance-status"></a><a class="link" href="#instance-status">4.1. Instance Status</a></h3>
|
||||
<div class="paragraph">
|
||||
<p>Netflix Eureka supports having instances that are <code>OUT_OF_SERVICE</code> registered with the
|
||||
server. These instances are not returned as active service instances. This is useful for
|
||||
@@ -441,7 +441,7 @@ instance status actuator endpoint, as shown in the following example:</p>
|
||||
<i class="fa icon-note" title="Note"></i>
|
||||
</td>
|
||||
<td class="content">
|
||||
The preceding example uses the <code>http</code> command from <a href="https://httpie.org" class="bare">https://httpie.org</a>.
|
||||
The preceding example uses the <code>http</code> command from <a href="https://httpie.org" class="bare">httpie.org</a>.
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
@@ -450,7 +450,7 @@ The preceding example uses the <code>http</code> command from <a href="https://h
|
||||
</div>
|
||||
</div>
|
||||
<div class="sect1">
|
||||
<h2 id="spring-cloud-zookeeper-dependencies"><a class="link" href="#spring-cloud-zookeeper-dependencies">Zookeeper Dependencies</a></h2>
|
||||
<h2 id="spring-cloud-zookeeper-dependencies"><a class="anchor" href="#spring-cloud-zookeeper-dependencies"></a><a class="link" href="#spring-cloud-zookeeper-dependencies">5. Zookeeper Dependencies</a></h2>
|
||||
<div class="sectionbody">
|
||||
<div class="paragraph">
|
||||
<p>The following topics cover how to work with Spring Cloud Zookeeper dependencies:</p>
|
||||
@@ -472,7 +472,7 @@ The preceding example uses the <code>http</code> command from <a href="https://h
|
||||
</ul>
|
||||
</div>
|
||||
<div class="sect2">
|
||||
<h3 id="spring-cloud-zookeeper-dependencies-using"><a class="link" href="#spring-cloud-zookeeper-dependencies-using">Using the Zookeeper Dependencies</a></h3>
|
||||
<h3 id="spring-cloud-zookeeper-dependencies-using"><a class="anchor" href="#spring-cloud-zookeeper-dependencies-using"></a><a class="link" href="#spring-cloud-zookeeper-dependencies-using">5.1. Using the Zookeeper Dependencies</a></h3>
|
||||
<div class="paragraph">
|
||||
<p>Spring Cloud Zookeeper gives you a possibility to provide dependencies of your application
|
||||
as properties. As dependencies, you can understand other applications that are registered
|
||||
@@ -489,7 +489,7 @@ the state of your dependencies.</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="sect2">
|
||||
<h3 id="spring-cloud-zookeeper-dependencies-activating"><a class="link" href="#spring-cloud-zookeeper-dependencies-activating">Activating Zookeeper Dependencies</a></h3>
|
||||
<h3 id="spring-cloud-zookeeper-dependencies-activating"><a class="anchor" href="#spring-cloud-zookeeper-dependencies-activating"></a><a class="link" href="#spring-cloud-zookeeper-dependencies-activating">5.2. Activating Zookeeper Dependencies</a></h3>
|
||||
<div class="paragraph">
|
||||
<p>Including a dependency on
|
||||
<code>org.springframework.cloud:spring-cloud-starter-zookeeper-discovery</code> enables
|
||||
@@ -499,7 +499,7 @@ the dependencies in your properties, you can turn off the dependencies. To do so
|
||||
</div>
|
||||
</div>
|
||||
<div class="sect2">
|
||||
<h3 id="spring-cloud-zookeeper-dependencies-setting-up"><a class="link" href="#spring-cloud-zookeeper-dependencies-setting-up">Setting up Zookeeper Dependencies</a></h3>
|
||||
<h3 id="spring-cloud-zookeeper-dependencies-setting-up"><a class="anchor" href="#spring-cloud-zookeeper-dependencies-setting-up"></a><a class="link" href="#spring-cloud-zookeeper-dependencies-setting-up">5.3. Setting up Zookeeper Dependencies</a></h3>
|
||||
<div class="paragraph">
|
||||
<p>Consider the following example of dependency representation:</p>
|
||||
</div>
|
||||
@@ -534,7 +534,7 @@ spring.cloud.zookeeper:
|
||||
name is <code>spring.cloud.zookeeper.dependencies</code>.</p>
|
||||
</div>
|
||||
<div class="sect3">
|
||||
<h4 id="spring-cloud-zookeeper-dependencies-setting-up-aliases"><a class="link" href="#spring-cloud-zookeeper-dependencies-setting-up-aliases">Aliases</a></h4>
|
||||
<h4 id="spring-cloud-zookeeper-dependencies-setting-up-aliases"><a class="anchor" href="#spring-cloud-zookeeper-dependencies-setting-up-aliases"></a><a class="link" href="#spring-cloud-zookeeper-dependencies-setting-up-aliases">5.3.1. Aliases</a></h4>
|
||||
<div class="paragraph">
|
||||
<p>Below the root property you have to represent each dependency as an alias. This is due to
|
||||
the constraints of Ribbon, which requires that the application ID be placed in the URL.
|
||||
@@ -557,7 +557,7 @@ public interface NewsletterService {
|
||||
</div>
|
||||
</div>
|
||||
<div class="sect3">
|
||||
<h4 id="_path"><a class="link" href="#_path">Path</a></h4>
|
||||
<h4 id="path"><a class="anchor" href="#path"></a><a class="link" href="#path">5.3.2. Path</a></h4>
|
||||
<div class="paragraph">
|
||||
<p>The path is represented by the <code>path</code> YAML property and is the path under which the
|
||||
dependency is registered under Zookeeper. As described in the
|
||||
@@ -567,7 +567,7 @@ That is why Spring Cloud Zookeeper maps the alias to the proper path.</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="sect3">
|
||||
<h4 id="_load_balancer_type"><a class="link" href="#_load_balancer_type">Load Balancer Type</a></h4>
|
||||
<h4 id="load-balancer-type"><a class="anchor" href="#load-balancer-type"></a><a class="link" href="#load-balancer-type">5.3.3. Load Balancer Type</a></h4>
|
||||
<div class="paragraph">
|
||||
<p>The load balancer type is represented by <code>loadBalancerType</code> YAML property.</p>
|
||||
</div>
|
||||
@@ -591,7 +591,7 @@ applied. You can choose one of the following load balancing strategies:</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="sect3">
|
||||
<h4 id="_content_type_template_and_version"><a class="link" href="#_content_type_template_and_version"><code>Content-Type</code> Template and Version</a></h4>
|
||||
<h4 id="content-type-template-and-version"><a class="anchor" href="#content-type-template-and-version"></a><a class="link" href="#content-type-template-and-version">5.3.4. <code>Content-Type</code> Template and Version</a></h4>
|
||||
<div class="paragraph">
|
||||
<p>The <code>Content-Type</code> template and version are represented by the <code>contentTypeTemplate</code> and
|
||||
<code>version</code> YAML properties.</p>
|
||||
@@ -627,7 +627,7 @@ want to roam around your code to bump up the API version. That is why you can pr
|
||||
</div>
|
||||
</div>
|
||||
<div class="sect3">
|
||||
<h4 id="_default_headers"><a class="link" href="#_default_headers">Default Headers</a></h4>
|
||||
<h4 id="default-headers"><a class="anchor" href="#default-headers"></a><a class="link" href="#default-headers">5.3.5. Default Headers</a></h4>
|
||||
<div class="paragraph">
|
||||
<p>Default headers are represented by the <code>headers</code> map in YAML.</p>
|
||||
</div>
|
||||
@@ -652,7 +652,7 @@ appropriate list of values in your HTTP request.</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="sect3">
|
||||
<h4 id="_required_dependencies"><a class="link" href="#_required_dependencies">Required Dependencies</a></h4>
|
||||
<h4 id="required-dependencies"><a class="anchor" href="#required-dependencies"></a><a class="link" href="#required-dependencies">5.3.6. Required Dependencies</a></h4>
|
||||
<div class="paragraph">
|
||||
<p>Required dependencies are represented by <code>required</code> property in YAML.</p>
|
||||
</div>
|
||||
@@ -671,7 +671,7 @@ start if the required dependency is not registered in Zookeeper.</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="sect3">
|
||||
<h4 id="_stubs"><a class="link" href="#_stubs">Stubs</a></h4>
|
||||
<h4 id="stubs"><a class="anchor" href="#stubs"></a><a class="link" href="#stubs">5.3.7. Stubs</a></h4>
|
||||
<div class="paragraph">
|
||||
<p>You can provide a colon-separated path to the JAR containing stubs of the dependency, as
|
||||
shown in the following example:</p>
|
||||
@@ -705,7 +705,7 @@ example:</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="sect2">
|
||||
<h3 id="spring-cloud-zookeeper-dependencies-configuring"><a class="link" href="#spring-cloud-zookeeper-dependencies-configuring">Configuring Spring Cloud Zookeeper Dependencies</a></h3>
|
||||
<h3 id="spring-cloud-zookeeper-dependencies-configuring"><a class="anchor" href="#spring-cloud-zookeeper-dependencies-configuring"></a><a class="link" href="#spring-cloud-zookeeper-dependencies-configuring">5.4. Configuring Spring Cloud Zookeeper Dependencies</a></h3>
|
||||
<div class="paragraph">
|
||||
<p>You can set the following properties to enable or disable parts of Zookeeper Dependencies
|
||||
functionalities:</p>
|
||||
@@ -748,7 +748,7 @@ dependency configuration. Without this setting, those two parameters do not work
|
||||
</div>
|
||||
</div>
|
||||
<div class="sect1">
|
||||
<h2 id="spring-cloud-zookeeper-dependency-watcher"><a class="link" href="#spring-cloud-zookeeper-dependency-watcher">Spring Cloud Zookeeper Dependency Watcher</a></h2>
|
||||
<h2 id="spring-cloud-zookeeper-dependency-watcher"><a class="anchor" href="#spring-cloud-zookeeper-dependency-watcher"></a><a class="link" href="#spring-cloud-zookeeper-dependency-watcher">6. Spring Cloud Zookeeper Dependency Watcher</a></h2>
|
||||
<div class="sectionbody">
|
||||
<div class="paragraph">
|
||||
<p>The Dependency Watcher mechanism lets you register listeners to your dependencies. The
|
||||
@@ -756,14 +756,14 @@ functionality is, in fact, an implementation of the <code>Observator</code> patt
|
||||
dependency changes, its state (to either UP or DOWN), some custom logic can be applied.</p>
|
||||
</div>
|
||||
<div class="sect2">
|
||||
<h3 id="_activating_2"><a class="link" href="#_activating_2">Activating</a></h3>
|
||||
<h3 id="activating-2"><a class="anchor" href="#activating-2"></a><a class="link" href="#activating-2">6.1. Activating</a></h3>
|
||||
<div class="paragraph">
|
||||
<p>Spring Cloud Zookeeper Dependencies functionality needs to be enabled for you to use the
|
||||
Dependency Watcher mechanism.</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="sect2">
|
||||
<h3 id="_registering_a_listener"><a class="link" href="#_registering_a_listener">Registering a Listener</a></h3>
|
||||
<h3 id="registering-a-listener"><a class="anchor" href="#registering-a-listener"></a><a class="link" href="#registering-a-listener">6.2. Registering a Listener</a></h3>
|
||||
<div class="paragraph">
|
||||
<p>To register a listener, you must implement an interface called
|
||||
<code>org.springframework.cloud.zookeeper.discovery.watcher.DependencyWatcherListener</code> and
|
||||
@@ -781,7 +781,7 @@ information about whether your dependency has changed to <code>CONNECTED</code>
|
||||
</div>
|
||||
</div>
|
||||
<div class="sect2">
|
||||
<h3 id="spring-cloud-zookeeper-dependency-watcher-presence-checker"><a class="link" href="#spring-cloud-zookeeper-dependency-watcher-presence-checker">Using the Presence Checker</a></h3>
|
||||
<h3 id="spring-cloud-zookeeper-dependency-watcher-presence-checker"><a class="anchor" href="#spring-cloud-zookeeper-dependency-watcher-presence-checker"></a><a class="link" href="#spring-cloud-zookeeper-dependency-watcher-presence-checker">6.3. Using the Presence Checker</a></h3>
|
||||
<div class="paragraph">
|
||||
<p>Bound with the Dependency Watcher is the functionality called Presence Checker. It lets
|
||||
you provide custom behavior when your application boots, to react according to the state
|
||||
@@ -816,7 +816,7 @@ overridden.</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="sect1">
|
||||
<h2 id="spring-cloud-zookeeper-config"><a class="link" href="#spring-cloud-zookeeper-config">Distributed Configuration with Zookeeper</a></h2>
|
||||
<h2 id="spring-cloud-zookeeper-config"><a class="anchor" href="#spring-cloud-zookeeper-config"></a><a class="link" href="#spring-cloud-zookeeper-config">7. Distributed Configuration with Zookeeper</a></h2>
|
||||
<div class="sectionbody">
|
||||
<div class="paragraph">
|
||||
<p>Zookeeper provides a
|
||||
@@ -859,7 +859,7 @@ request to <code>/refresh</code> causes the configuration to be reloaded. Watchi
|
||||
namespace (which Zookeeper supports) is not currently implemented.</p>
|
||||
</div>
|
||||
<div class="sect2">
|
||||
<h3 id="_activating_3"><a class="link" href="#_activating_3">Activating</a></h3>
|
||||
<h3 id="activating-3"><a class="anchor" href="#activating-3"></a><a class="link" href="#activating-3">7.1. Activating</a></h3>
|
||||
<div class="paragraph">
|
||||
<p>Including a dependency on
|
||||
<code>org.springframework.cloud:spring-cloud-starter-zookeeper-config</code> enables
|
||||
@@ -880,7 +880,7 @@ the way you include the dependency as described <a href="#spring-cloud-zookeeper
|
||||
</div>
|
||||
</div>
|
||||
<div class="sect2">
|
||||
<h3 id="_customizing"><a class="link" href="#_customizing">Customizing</a></h3>
|
||||
<h3 id="customizing"><a class="anchor" href="#customizing"></a><a class="link" href="#customizing">7.2. Customizing</a></h3>
|
||||
<div class="paragraph">
|
||||
<p>Zookeeper Config may be customized by setting the following properties:</p>
|
||||
</div>
|
||||
@@ -916,7 +916,7 @@ property sources with profiles.</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="sect2">
|
||||
<h3 id="_access_control_lists_acls"><a class="link" href="#_access_control_lists_acls">Access Control Lists (ACLs)</a></h3>
|
||||
<h3 id="access-control-lists-acls"><a class="anchor" href="#access-control-lists-acls"></a><a class="link" href="#access-control-lists-acls">7.3. Access Control Lists (ACLs)</a></h3>
|
||||
<div class="paragraph">
|
||||
<p>You can add authentication information for Zookeeper ACLs by calling the <code>addAuthInfo</code>
|
||||
method of a <code>CuratorFramework</code> bean. One way to accomplish this is to provide your own
|
||||
|
||||
@@ -95,8 +95,8 @@ $(addBlockSwitches);
|
||||
<div id="toc" class="toc2">
|
||||
<div id="toctitle">Table of Contents</div>
|
||||
<ul class="sectlevel1">
|
||||
<li><a href="#_features">Features</a></li>
|
||||
<li><a href="#_quick_start">Quick Start</a></li>
|
||||
<li><a href="#features">1. Features</a></li>
|
||||
<li><a href="#quick-start">2. Quick Start</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
@@ -109,7 +109,7 @@ $(addBlockSwitches);
|
||||
</div>
|
||||
</div>
|
||||
<div class="sect1">
|
||||
<h2 id="_features"><a class="link" href="#_features">Features</a></h2>
|
||||
<h2 id="features"><a class="anchor" href="#features"></a><a class="link" href="#features">1. Features</a></h2>
|
||||
<div class="sectionbody">
|
||||
<div class="ulist">
|
||||
<ul>
|
||||
@@ -130,7 +130,7 @@ $(addBlockSwitches);
|
||||
</div>
|
||||
</div>
|
||||
<div class="sect1">
|
||||
<h2 id="_quick_start"><a class="link" href="#_quick_start">Quick Start</a></h2>
|
||||
<h2 id="quick-start"><a class="anchor" href="#quick-start"></a><a class="link" href="#quick-start">2. Quick Start</a></h2>
|
||||
<div class="sectionbody">
|
||||
<div class="paragraph">
|
||||
<p>As long as Spring Cloud Zookeeper, <a href="http://curator.apache.org/">Apache Curator</a> and the Zookeeper Java Client are on the
|
||||
|
||||
@@ -96,44 +96,44 @@ $(addBlockSwitches);
|
||||
<div id="toc" class="toc2">
|
||||
<div id="toctitle">Table of Contents</div>
|
||||
<ul class="sectlevel1">
|
||||
<li><a href="#spring-cloud-zookeeper-install">Install Zookeeper</a></li>
|
||||
<li><a href="#spring-cloud-zookeeper-discovery">Service Discovery with Zookeeper</a>
|
||||
<li><a href="#spring-cloud-zookeeper-install">1. Install Zookeeper</a></li>
|
||||
<li><a href="#spring-cloud-zookeeper-discovery">2. Service Discovery with Zookeeper</a>
|
||||
<ul class="sectlevel2">
|
||||
<li><a href="#_activating">Activating</a></li>
|
||||
<li><a href="#_registering_with_zookeeper">Registering with Zookeeper</a></li>
|
||||
<li><a href="#_using_the_discoveryclient">Using the DiscoveryClient</a></li>
|
||||
<li><a href="#activating">2.1. Activating</a></li>
|
||||
<li><a href="#registering-with-zookeeper">2.2. Registering with Zookeeper</a></li>
|
||||
<li><a href="#using-the-discoveryclient">2.3. Using the DiscoveryClient</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li><a href="#spring-cloud-zookeeper-netflix">Using Spring Cloud Zookeeper with Spring Cloud Netflix Components</a>
|
||||
<li><a href="#spring-cloud-zookeeper-netflix">3. Using Spring Cloud Zookeeper with Spring Cloud Netflix Components</a>
|
||||
<ul class="sectlevel2">
|
||||
<li><a href="#_ribbon_with_zookeeper">Ribbon with Zookeeper</a></li>
|
||||
<li><a href="#ribbon-with-zookeeper">3.1. Ribbon with Zookeeper</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li><a href="#spring-cloud-zookeeper-service-registry">Spring Cloud Zookeeper and Service Registry</a>
|
||||
<li><a href="#spring-cloud-zookeeper-service-registry">4. Spring Cloud Zookeeper and Service Registry</a>
|
||||
<ul class="sectlevel2">
|
||||
<li><a href="#_instance_status">Instance Status</a></li>
|
||||
<li><a href="#instance-status">4.1. Instance Status</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li><a href="#spring-cloud-zookeeper-dependencies">Zookeeper Dependencies</a>
|
||||
<li><a href="#spring-cloud-zookeeper-dependencies">5. Zookeeper Dependencies</a>
|
||||
<ul class="sectlevel2">
|
||||
<li><a href="#spring-cloud-zookeeper-dependencies-using">Using the Zookeeper Dependencies</a></li>
|
||||
<li><a href="#spring-cloud-zookeeper-dependencies-activating">Activating Zookeeper Dependencies</a></li>
|
||||
<li><a href="#spring-cloud-zookeeper-dependencies-setting-up">Setting up Zookeeper Dependencies</a></li>
|
||||
<li><a href="#spring-cloud-zookeeper-dependencies-configuring">Configuring Spring Cloud Zookeeper Dependencies</a></li>
|
||||
<li><a href="#spring-cloud-zookeeper-dependencies-using">5.1. Using the Zookeeper Dependencies</a></li>
|
||||
<li><a href="#spring-cloud-zookeeper-dependencies-activating">5.2. Activating Zookeeper Dependencies</a></li>
|
||||
<li><a href="#spring-cloud-zookeeper-dependencies-setting-up">5.3. Setting up Zookeeper Dependencies</a></li>
|
||||
<li><a href="#spring-cloud-zookeeper-dependencies-configuring">5.4. Configuring Spring Cloud Zookeeper Dependencies</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li><a href="#spring-cloud-zookeeper-dependency-watcher">Spring Cloud Zookeeper Dependency Watcher</a>
|
||||
<li><a href="#spring-cloud-zookeeper-dependency-watcher">6. Spring Cloud Zookeeper Dependency Watcher</a>
|
||||
<ul class="sectlevel2">
|
||||
<li><a href="#_activating_2">Activating</a></li>
|
||||
<li><a href="#_registering_a_listener">Registering a Listener</a></li>
|
||||
<li><a href="#spring-cloud-zookeeper-dependency-watcher-presence-checker">Using the Presence Checker</a></li>
|
||||
<li><a href="#activating-2">6.1. Activating</a></li>
|
||||
<li><a href="#registering-a-listener">6.2. Registering a Listener</a></li>
|
||||
<li><a href="#spring-cloud-zookeeper-dependency-watcher-presence-checker">6.3. Using the Presence Checker</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li><a href="#spring-cloud-zookeeper-config">Distributed Configuration with Zookeeper</a>
|
||||
<li><a href="#spring-cloud-zookeeper-config">7. Distributed Configuration with Zookeeper</a>
|
||||
<ul class="sectlevel2">
|
||||
<li><a href="#_activating_3">Activating</a></li>
|
||||
<li><a href="#_customizing">Customizing</a></li>
|
||||
<li><a href="#_access_control_lists_acls">Access Control Lists (ACLs)</a></li>
|
||||
<li><a href="#activating-3">7.1. Activating</a></li>
|
||||
<li><a href="#customizing">7.2. Customizing</a></li>
|
||||
<li><a href="#access-control-lists-acls">7.3. Access Control Lists (ACLs)</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
@@ -154,7 +154,7 @@ with Spring Cloud Netflix provides Intelligent Routing (Zuul), Client Side Load
|
||||
</div>
|
||||
</div>
|
||||
<div class="sect1">
|
||||
<h2 id="spring-cloud-zookeeper-install"><a class="link" href="#spring-cloud-zookeeper-install">Install Zookeeper</a></h2>
|
||||
<h2 id="spring-cloud-zookeeper-install"><a class="anchor" href="#spring-cloud-zookeeper-install"></a><a class="link" href="#spring-cloud-zookeeper-install">1. Install Zookeeper</a></h2>
|
||||
<div class="sectionbody">
|
||||
<div class="paragraph">
|
||||
<p>See the <a href="https://zookeeper.apache.org/doc/current/zookeeperStarted.html">installation
|
||||
@@ -213,7 +213,7 @@ compile('org.apache.zookeeper:zookeeper:3.4.12') {
|
||||
</div>
|
||||
</div>
|
||||
<div class="sect1">
|
||||
<h2 id="spring-cloud-zookeeper-discovery"><a class="link" href="#spring-cloud-zookeeper-discovery">Service Discovery with Zookeeper</a></h2>
|
||||
<h2 id="spring-cloud-zookeeper-discovery"><a class="anchor" href="#spring-cloud-zookeeper-discovery"></a><a class="link" href="#spring-cloud-zookeeper-discovery">2. Service Discovery with Zookeeper</a></h2>
|
||||
<div class="sectionbody">
|
||||
<div class="paragraph">
|
||||
<p>Service Discovery is one of the key tenets of a microservice based architecture. Trying to
|
||||
@@ -224,7 +224,7 @@ Extension</a>. Spring Cloud Zookeeper uses this extension for service registrati
|
||||
discovery.</p>
|
||||
</div>
|
||||
<div class="sect2">
|
||||
<h3 id="_activating"><a class="link" href="#_activating">Activating</a></h3>
|
||||
<h3 id="activating"><a class="anchor" href="#activating"></a><a class="link" href="#activating">2.1. Activating</a></h3>
|
||||
<div class="paragraph">
|
||||
<p>Including a dependency on
|
||||
<code>org.springframework.cloud:spring-cloud-starter-zookeeper-discovery</code> enables
|
||||
@@ -258,7 +258,7 @@ the way you include the dependency as described <a href="#spring-cloud-zookeeper
|
||||
</div>
|
||||
</div>
|
||||
<div class="sect2">
|
||||
<h3 id="_registering_with_zookeeper"><a class="link" href="#_registering_with_zookeeper">Registering with Zookeeper</a></h3>
|
||||
<h3 id="registering-with-zookeeper"><a class="anchor" href="#registering-with-zookeeper"></a><a class="link" href="#registering-with-zookeeper">2.2. Registering with Zookeeper</a></h3>
|
||||
<div class="paragraph">
|
||||
<p>When a client registers with Zookeeper, it provides metadata (such as host and port, ID,
|
||||
and name) about itself.</p>
|
||||
@@ -338,7 +338,7 @@ query Zookeeper to locate other services).</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="sect2">
|
||||
<h3 id="_using_the_discoveryclient"><a class="link" href="#_using_the_discoveryclient">Using the DiscoveryClient</a></h3>
|
||||
<h3 id="using-the-discoveryclient"><a class="anchor" href="#using-the-discoveryclient"></a><a class="link" href="#using-the-discoveryclient">2.3. Using the DiscoveryClient</a></h3>
|
||||
<div class="paragraph">
|
||||
<p>Spring Cloud has support for
|
||||
<a href="https://github.com/spring-cloud/spring-cloud-netflix/blob/master/docs/src/main/asciidoc/spring-cloud-netflix.adoc#spring-cloud-feign">Feign</a>
|
||||
@@ -370,7 +370,7 @@ public String serviceUrl() {
|
||||
</div>
|
||||
</div>
|
||||
<div class="sect1">
|
||||
<h2 id="spring-cloud-zookeeper-netflix"><a class="link" href="#spring-cloud-zookeeper-netflix">Using Spring Cloud Zookeeper with Spring Cloud Netflix Components</a></h2>
|
||||
<h2 id="spring-cloud-zookeeper-netflix"><a class="anchor" href="#spring-cloud-zookeeper-netflix"></a><a class="link" href="#spring-cloud-zookeeper-netflix">3. Using Spring Cloud Zookeeper with Spring Cloud Netflix Components</a></h2>
|
||||
<div class="sectionbody">
|
||||
<div class="paragraph">
|
||||
<p>Spring Cloud Netflix supplies useful tools that work regardless of which <code>DiscoveryClient</code>
|
||||
@@ -378,7 +378,7 @@ implementation you use. Feign, Turbine, Ribbon, and Zuul all work with Spring Cl
|
||||
Zookeeper.</p>
|
||||
</div>
|
||||
<div class="sect2">
|
||||
<h3 id="_ribbon_with_zookeeper"><a class="link" href="#_ribbon_with_zookeeper">Ribbon with Zookeeper</a></h3>
|
||||
<h3 id="ribbon-with-zookeeper"><a class="anchor" href="#ribbon-with-zookeeper"></a><a class="link" href="#ribbon-with-zookeeper">3.1. Ribbon with Zookeeper</a></h3>
|
||||
<div class="paragraph">
|
||||
<p>Spring Cloud Zookeeper provides an implementation of Ribbon’s <code>ServerList</code>. When you use
|
||||
the <code>spring-cloud-starter-zookeeper-discovery</code>, Ribbon is autoconfigured to use the
|
||||
@@ -388,7 +388,7 @@ the <code>spring-cloud-starter-zookeeper-discovery</code>, Ribbon is autoconfig
|
||||
</div>
|
||||
</div>
|
||||
<div class="sect1">
|
||||
<h2 id="spring-cloud-zookeeper-service-registry"><a class="link" href="#spring-cloud-zookeeper-service-registry">Spring Cloud Zookeeper and Service Registry</a></h2>
|
||||
<h2 id="spring-cloud-zookeeper-service-registry"><a class="anchor" href="#spring-cloud-zookeeper-service-registry"></a><a class="link" href="#spring-cloud-zookeeper-service-registry">4. Spring Cloud Zookeeper and Service Registry</a></h2>
|
||||
<div class="sectionbody">
|
||||
<div class="paragraph">
|
||||
<p>Spring Cloud Zookeeper implements the <code>ServiceRegistry</code> interface, letting developers
|
||||
@@ -416,7 +416,7 @@ public void registerThings() {
|
||||
</div>
|
||||
</div>
|
||||
<div class="sect2">
|
||||
<h3 id="_instance_status"><a class="link" href="#_instance_status">Instance Status</a></h3>
|
||||
<h3 id="instance-status"><a class="anchor" href="#instance-status"></a><a class="link" href="#instance-status">4.1. Instance Status</a></h3>
|
||||
<div class="paragraph">
|
||||
<p>Netflix Eureka supports having instances that are <code>OUT_OF_SERVICE</code> registered with the
|
||||
server. These instances are not returned as active service instances. This is useful for
|
||||
@@ -441,7 +441,7 @@ instance status actuator endpoint, as shown in the following example:</p>
|
||||
<i class="fa icon-note" title="Note"></i>
|
||||
</td>
|
||||
<td class="content">
|
||||
The preceding example uses the <code>http</code> command from <a href="https://httpie.org" class="bare">https://httpie.org</a>.
|
||||
The preceding example uses the <code>http</code> command from <a href="https://httpie.org" class="bare">httpie.org</a>.
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
@@ -450,7 +450,7 @@ The preceding example uses the <code>http</code> command from <a href="https://h
|
||||
</div>
|
||||
</div>
|
||||
<div class="sect1">
|
||||
<h2 id="spring-cloud-zookeeper-dependencies"><a class="link" href="#spring-cloud-zookeeper-dependencies">Zookeeper Dependencies</a></h2>
|
||||
<h2 id="spring-cloud-zookeeper-dependencies"><a class="anchor" href="#spring-cloud-zookeeper-dependencies"></a><a class="link" href="#spring-cloud-zookeeper-dependencies">5. Zookeeper Dependencies</a></h2>
|
||||
<div class="sectionbody">
|
||||
<div class="paragraph">
|
||||
<p>The following topics cover how to work with Spring Cloud Zookeeper dependencies:</p>
|
||||
@@ -472,7 +472,7 @@ The preceding example uses the <code>http</code> command from <a href="https://h
|
||||
</ul>
|
||||
</div>
|
||||
<div class="sect2">
|
||||
<h3 id="spring-cloud-zookeeper-dependencies-using"><a class="link" href="#spring-cloud-zookeeper-dependencies-using">Using the Zookeeper Dependencies</a></h3>
|
||||
<h3 id="spring-cloud-zookeeper-dependencies-using"><a class="anchor" href="#spring-cloud-zookeeper-dependencies-using"></a><a class="link" href="#spring-cloud-zookeeper-dependencies-using">5.1. Using the Zookeeper Dependencies</a></h3>
|
||||
<div class="paragraph">
|
||||
<p>Spring Cloud Zookeeper gives you a possibility to provide dependencies of your application
|
||||
as properties. As dependencies, you can understand other applications that are registered
|
||||
@@ -489,7 +489,7 @@ the state of your dependencies.</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="sect2">
|
||||
<h3 id="spring-cloud-zookeeper-dependencies-activating"><a class="link" href="#spring-cloud-zookeeper-dependencies-activating">Activating Zookeeper Dependencies</a></h3>
|
||||
<h3 id="spring-cloud-zookeeper-dependencies-activating"><a class="anchor" href="#spring-cloud-zookeeper-dependencies-activating"></a><a class="link" href="#spring-cloud-zookeeper-dependencies-activating">5.2. Activating Zookeeper Dependencies</a></h3>
|
||||
<div class="paragraph">
|
||||
<p>Including a dependency on
|
||||
<code>org.springframework.cloud:spring-cloud-starter-zookeeper-discovery</code> enables
|
||||
@@ -499,7 +499,7 @@ the dependencies in your properties, you can turn off the dependencies. To do so
|
||||
</div>
|
||||
</div>
|
||||
<div class="sect2">
|
||||
<h3 id="spring-cloud-zookeeper-dependencies-setting-up"><a class="link" href="#spring-cloud-zookeeper-dependencies-setting-up">Setting up Zookeeper Dependencies</a></h3>
|
||||
<h3 id="spring-cloud-zookeeper-dependencies-setting-up"><a class="anchor" href="#spring-cloud-zookeeper-dependencies-setting-up"></a><a class="link" href="#spring-cloud-zookeeper-dependencies-setting-up">5.3. Setting up Zookeeper Dependencies</a></h3>
|
||||
<div class="paragraph">
|
||||
<p>Consider the following example of dependency representation:</p>
|
||||
</div>
|
||||
@@ -534,7 +534,7 @@ spring.cloud.zookeeper:
|
||||
name is <code>spring.cloud.zookeeper.dependencies</code>.</p>
|
||||
</div>
|
||||
<div class="sect3">
|
||||
<h4 id="spring-cloud-zookeeper-dependencies-setting-up-aliases"><a class="link" href="#spring-cloud-zookeeper-dependencies-setting-up-aliases">Aliases</a></h4>
|
||||
<h4 id="spring-cloud-zookeeper-dependencies-setting-up-aliases"><a class="anchor" href="#spring-cloud-zookeeper-dependencies-setting-up-aliases"></a><a class="link" href="#spring-cloud-zookeeper-dependencies-setting-up-aliases">5.3.1. Aliases</a></h4>
|
||||
<div class="paragraph">
|
||||
<p>Below the root property you have to represent each dependency as an alias. This is due to
|
||||
the constraints of Ribbon, which requires that the application ID be placed in the URL.
|
||||
@@ -557,7 +557,7 @@ public interface NewsletterService {
|
||||
</div>
|
||||
</div>
|
||||
<div class="sect3">
|
||||
<h4 id="_path"><a class="link" href="#_path">Path</a></h4>
|
||||
<h4 id="path"><a class="anchor" href="#path"></a><a class="link" href="#path">5.3.2. Path</a></h4>
|
||||
<div class="paragraph">
|
||||
<p>The path is represented by the <code>path</code> YAML property and is the path under which the
|
||||
dependency is registered under Zookeeper. As described in the
|
||||
@@ -567,7 +567,7 @@ That is why Spring Cloud Zookeeper maps the alias to the proper path.</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="sect3">
|
||||
<h4 id="_load_balancer_type"><a class="link" href="#_load_balancer_type">Load Balancer Type</a></h4>
|
||||
<h4 id="load-balancer-type"><a class="anchor" href="#load-balancer-type"></a><a class="link" href="#load-balancer-type">5.3.3. Load Balancer Type</a></h4>
|
||||
<div class="paragraph">
|
||||
<p>The load balancer type is represented by <code>loadBalancerType</code> YAML property.</p>
|
||||
</div>
|
||||
@@ -591,7 +591,7 @@ applied. You can choose one of the following load balancing strategies:</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="sect3">
|
||||
<h4 id="_content_type_template_and_version"><a class="link" href="#_content_type_template_and_version"><code>Content-Type</code> Template and Version</a></h4>
|
||||
<h4 id="content-type-template-and-version"><a class="anchor" href="#content-type-template-and-version"></a><a class="link" href="#content-type-template-and-version">5.3.4. <code>Content-Type</code> Template and Version</a></h4>
|
||||
<div class="paragraph">
|
||||
<p>The <code>Content-Type</code> template and version are represented by the <code>contentTypeTemplate</code> and
|
||||
<code>version</code> YAML properties.</p>
|
||||
@@ -627,7 +627,7 @@ want to roam around your code to bump up the API version. That is why you can pr
|
||||
</div>
|
||||
</div>
|
||||
<div class="sect3">
|
||||
<h4 id="_default_headers"><a class="link" href="#_default_headers">Default Headers</a></h4>
|
||||
<h4 id="default-headers"><a class="anchor" href="#default-headers"></a><a class="link" href="#default-headers">5.3.5. Default Headers</a></h4>
|
||||
<div class="paragraph">
|
||||
<p>Default headers are represented by the <code>headers</code> map in YAML.</p>
|
||||
</div>
|
||||
@@ -652,7 +652,7 @@ appropriate list of values in your HTTP request.</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="sect3">
|
||||
<h4 id="_required_dependencies"><a class="link" href="#_required_dependencies">Required Dependencies</a></h4>
|
||||
<h4 id="required-dependencies"><a class="anchor" href="#required-dependencies"></a><a class="link" href="#required-dependencies">5.3.6. Required Dependencies</a></h4>
|
||||
<div class="paragraph">
|
||||
<p>Required dependencies are represented by <code>required</code> property in YAML.</p>
|
||||
</div>
|
||||
@@ -671,7 +671,7 @@ start if the required dependency is not registered in Zookeeper.</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="sect3">
|
||||
<h4 id="_stubs"><a class="link" href="#_stubs">Stubs</a></h4>
|
||||
<h4 id="stubs"><a class="anchor" href="#stubs"></a><a class="link" href="#stubs">5.3.7. Stubs</a></h4>
|
||||
<div class="paragraph">
|
||||
<p>You can provide a colon-separated path to the JAR containing stubs of the dependency, as
|
||||
shown in the following example:</p>
|
||||
@@ -705,7 +705,7 @@ example:</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="sect2">
|
||||
<h3 id="spring-cloud-zookeeper-dependencies-configuring"><a class="link" href="#spring-cloud-zookeeper-dependencies-configuring">Configuring Spring Cloud Zookeeper Dependencies</a></h3>
|
||||
<h3 id="spring-cloud-zookeeper-dependencies-configuring"><a class="anchor" href="#spring-cloud-zookeeper-dependencies-configuring"></a><a class="link" href="#spring-cloud-zookeeper-dependencies-configuring">5.4. Configuring Spring Cloud Zookeeper Dependencies</a></h3>
|
||||
<div class="paragraph">
|
||||
<p>You can set the following properties to enable or disable parts of Zookeeper Dependencies
|
||||
functionalities:</p>
|
||||
@@ -748,7 +748,7 @@ dependency configuration. Without this setting, those two parameters do not work
|
||||
</div>
|
||||
</div>
|
||||
<div class="sect1">
|
||||
<h2 id="spring-cloud-zookeeper-dependency-watcher"><a class="link" href="#spring-cloud-zookeeper-dependency-watcher">Spring Cloud Zookeeper Dependency Watcher</a></h2>
|
||||
<h2 id="spring-cloud-zookeeper-dependency-watcher"><a class="anchor" href="#spring-cloud-zookeeper-dependency-watcher"></a><a class="link" href="#spring-cloud-zookeeper-dependency-watcher">6. Spring Cloud Zookeeper Dependency Watcher</a></h2>
|
||||
<div class="sectionbody">
|
||||
<div class="paragraph">
|
||||
<p>The Dependency Watcher mechanism lets you register listeners to your dependencies. The
|
||||
@@ -756,14 +756,14 @@ functionality is, in fact, an implementation of the <code>Observator</code> patt
|
||||
dependency changes, its state (to either UP or DOWN), some custom logic can be applied.</p>
|
||||
</div>
|
||||
<div class="sect2">
|
||||
<h3 id="_activating_2"><a class="link" href="#_activating_2">Activating</a></h3>
|
||||
<h3 id="activating-2"><a class="anchor" href="#activating-2"></a><a class="link" href="#activating-2">6.1. Activating</a></h3>
|
||||
<div class="paragraph">
|
||||
<p>Spring Cloud Zookeeper Dependencies functionality needs to be enabled for you to use the
|
||||
Dependency Watcher mechanism.</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="sect2">
|
||||
<h3 id="_registering_a_listener"><a class="link" href="#_registering_a_listener">Registering a Listener</a></h3>
|
||||
<h3 id="registering-a-listener"><a class="anchor" href="#registering-a-listener"></a><a class="link" href="#registering-a-listener">6.2. Registering a Listener</a></h3>
|
||||
<div class="paragraph">
|
||||
<p>To register a listener, you must implement an interface called
|
||||
<code>org.springframework.cloud.zookeeper.discovery.watcher.DependencyWatcherListener</code> and
|
||||
@@ -781,7 +781,7 @@ information about whether your dependency has changed to <code>CONNECTED</code>
|
||||
</div>
|
||||
</div>
|
||||
<div class="sect2">
|
||||
<h3 id="spring-cloud-zookeeper-dependency-watcher-presence-checker"><a class="link" href="#spring-cloud-zookeeper-dependency-watcher-presence-checker">Using the Presence Checker</a></h3>
|
||||
<h3 id="spring-cloud-zookeeper-dependency-watcher-presence-checker"><a class="anchor" href="#spring-cloud-zookeeper-dependency-watcher-presence-checker"></a><a class="link" href="#spring-cloud-zookeeper-dependency-watcher-presence-checker">6.3. Using the Presence Checker</a></h3>
|
||||
<div class="paragraph">
|
||||
<p>Bound with the Dependency Watcher is the functionality called Presence Checker. It lets
|
||||
you provide custom behavior when your application boots, to react according to the state
|
||||
@@ -816,7 +816,7 @@ overridden.</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="sect1">
|
||||
<h2 id="spring-cloud-zookeeper-config"><a class="link" href="#spring-cloud-zookeeper-config">Distributed Configuration with Zookeeper</a></h2>
|
||||
<h2 id="spring-cloud-zookeeper-config"><a class="anchor" href="#spring-cloud-zookeeper-config"></a><a class="link" href="#spring-cloud-zookeeper-config">7. Distributed Configuration with Zookeeper</a></h2>
|
||||
<div class="sectionbody">
|
||||
<div class="paragraph">
|
||||
<p>Zookeeper provides a
|
||||
@@ -859,7 +859,7 @@ request to <code>/refresh</code> causes the configuration to be reloaded. Watchi
|
||||
namespace (which Zookeeper supports) is not currently implemented.</p>
|
||||
</div>
|
||||
<div class="sect2">
|
||||
<h3 id="_activating_3"><a class="link" href="#_activating_3">Activating</a></h3>
|
||||
<h3 id="activating-3"><a class="anchor" href="#activating-3"></a><a class="link" href="#activating-3">7.1. Activating</a></h3>
|
||||
<div class="paragraph">
|
||||
<p>Including a dependency on
|
||||
<code>org.springframework.cloud:spring-cloud-starter-zookeeper-config</code> enables
|
||||
@@ -880,7 +880,7 @@ the way you include the dependency as described <a href="#spring-cloud-zookeeper
|
||||
</div>
|
||||
</div>
|
||||
<div class="sect2">
|
||||
<h3 id="_customizing"><a class="link" href="#_customizing">Customizing</a></h3>
|
||||
<h3 id="customizing"><a class="anchor" href="#customizing"></a><a class="link" href="#customizing">7.2. Customizing</a></h3>
|
||||
<div class="paragraph">
|
||||
<p>Zookeeper Config may be customized by setting the following properties:</p>
|
||||
</div>
|
||||
@@ -916,7 +916,7 @@ property sources with profiles.</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="sect2">
|
||||
<h3 id="_access_control_lists_acls"><a class="link" href="#_access_control_lists_acls">Access Control Lists (ACLs)</a></h3>
|
||||
<h3 id="access-control-lists-acls"><a class="anchor" href="#access-control-lists-acls"></a><a class="link" href="#access-control-lists-acls">7.3. Access Control Lists (ACLs)</a></h3>
|
||||
<div class="paragraph">
|
||||
<p>You can add authentication information for Zookeeper ACLs by calling the <code>addAuthInfo</code>
|
||||
method of a <code>CuratorFramework</code> bean. One way to accomplish this is to provide your own
|
||||
|
||||
Reference in New Issue
Block a user