Sync docs from v3.0.0-M2 to gh-pages
755
spring-cloud-netflix/3.0.0-M2/reference/html/README.html
Normal file
@@ -0,0 +1,755 @@
|
||||
<!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.8">
|
||||
<title>Features</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};
|
||||
}
|
||||
|
||||
function globalSwitch() {
|
||||
$('.switch--item').each(function() {
|
||||
$(this).off('click');
|
||||
$(this).on('click', function() {
|
||||
selectedText = $(this).text()
|
||||
selectedIndex = $(this).index()
|
||||
$(".switch--item").filter(function() { return ($(this).text() === selectedText) }).each(function() {
|
||||
$(this).addClass('selected');
|
||||
$(this).siblings().removeClass('selected');
|
||||
selectedContent = $(this).parent().siblings(".content").eq(selectedIndex)
|
||||
selectedContent.removeClass('hidden');
|
||||
selectedContent.siblings().addClass('hidden');
|
||||
});
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
$(addBlockSwitches);
|
||||
$(globalSwitch);
|
||||
|
||||
</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="#features">1. Features</a></li>
|
||||
<li><a href="#modules-in-maintenance-mode">2. Modules In Maintenance Mode</a></li>
|
||||
<li><a href="#building">3. Building</a>
|
||||
<ul class="sectlevel2">
|
||||
<li><a href="#basic-compile-and-test">3.1. Basic Compile and Test</a></li>
|
||||
<li><a href="#documentation">3.2. Documentation</a></li>
|
||||
<li><a href="#working-with-the-code">3.3. Working with the code</a>
|
||||
<ul class="sectlevel3">
|
||||
<li><a href="#activate-the-spring-maven-profile">3.3.1. Activate the Spring Maven profile</a></li>
|
||||
<li><a href="#importing-into-eclipse-with-m2eclipse">3.3.2. Importing into eclipse with m2eclipse</a></li>
|
||||
<li><a href="#importing-into-eclipse-without-m2eclipse">3.3.3. Importing into eclipse without m2eclipse</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li><a href="#contributing">4. Contributing</a>
|
||||
<ul class="sectlevel2">
|
||||
<li><a href="#sign-the-contributor-license-agreement">4.1. Sign the Contributor License Agreement</a></li>
|
||||
<li><a href="#code-of-conduct">4.2. Code of Conduct</a></li>
|
||||
<li><a href="#code-conventions-and-housekeeping">4.3. Code Conventions and Housekeeping</a></li>
|
||||
<li><a href="#checkstyle">4.4. Checkstyle</a>
|
||||
<ul class="sectlevel3">
|
||||
<li><a href="#checkstyle-configuration">4.4.1. Checkstyle configuration</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li><a href="#ide-setup">4.5. IDE setup</a>
|
||||
<ul class="sectlevel3">
|
||||
<li><a href="#intellij-idea">4.5.1. Intellij IDEA</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div id="content">
|
||||
<div id="preamble">
|
||||
<div class="sectionbody">
|
||||
<div class="imageblock">
|
||||
<div class="content">
|
||||
<a class="image" href="https://circleci.com/gh/spring-cloud/spring-cloud-netflix/tree/master"><img src="https://circleci.com/gh/spring-cloud/spring-cloud-netflix/tree/master.svg?style=svg" alt="CircleCI"></a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="imageblock">
|
||||
<div class="content">
|
||||
<a class="image" href="https://codecov.io/gh/spring-cloud/spring-cloud-netflix/branch/master"><img src="https://codecov.io/gh/spring-cloud/spring-cloud-netflix/branch/master/graph/badge.svg" alt="Codecov"></a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="imageblock">
|
||||
<div class="content">
|
||||
<a class="image" href="https://www.codacy.com/app/Spring-Cloud/spring-cloud-netflix?utm_source=github.com&utm_medium=referral&utm_content=spring-cloud/spring-cloud-netflix&utm_campaign=Badge_Grade"><img src="https://api.codacy.com/project/badge/Grade/a6885a06921e4f72a0df0b7aabd6d118" alt="Codacy code quality"></a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="paragraph">
|
||||
<p>This project provides Netflix OSS 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 battle-tested Netflix components. The
|
||||
patterns provided include Service Discovery (Eureka), Circuit Breaker (Hystrix),
|
||||
Intelligent Routing (Zuul) and Client Side Load Balancing (Ribbon).</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="sect1">
|
||||
<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>
|
||||
<li>
|
||||
<p>Service Discovery: Eureka instances can be registered and clients can discover the instances using Spring-managed beans</p>
|
||||
</li>
|
||||
<li>
|
||||
<p>Service Discovery: an embedded Eureka server can be created with declarative Java configuration</p>
|
||||
</li>
|
||||
<li>
|
||||
<p>Circuit Breaker: Hystrix clients can be built with a simple annotation-driven method decorator</p>
|
||||
</li>
|
||||
<li>
|
||||
<p>Circuit Breaker: embedded Hystrix dashboard with declarative Java configuration</p>
|
||||
</li>
|
||||
<li>
|
||||
<p>Client Side Load Balancer: Ribbon</p>
|
||||
</li>
|
||||
<li>
|
||||
<p>External Configuration: a bridge from the Spring Environment to Archaius (enables native configuration of Netflix components using Spring Boot conventions)</p>
|
||||
</li>
|
||||
<li>
|
||||
<p>Router and Filter: automatic registration of Zuul filters, and a simple convention over configuration approach to reverse proxy creation</p>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="sect1">
|
||||
<h2 id="modules-in-maintenance-mode"><a class="anchor" href="#modules-in-maintenance-mode"></a><a class="link" href="#modules-in-maintenance-mode">2. Modules In Maintenance Mode</a></h2>
|
||||
<div class="sectionbody">
|
||||
<div class="paragraph">
|
||||
<p>Placing a module in maintenance mode means that the Spring Cloud team will no longer be adding new features to the module.
|
||||
We will fix blocker bugs and security issues, and we will also consider and review small pull requests from the community.</p>
|
||||
</div>
|
||||
<div class="paragraph">
|
||||
<p>We intend to continue to support these modules for a period of at least a year from the general availability
|
||||
of the Greenwich release train.</p>
|
||||
</div>
|
||||
<div class="paragraph">
|
||||
<p>The following Spring Cloud Netflix modules and corresponding starters will be placed into maintenance mode:</p>
|
||||
</div>
|
||||
<div class="ulist">
|
||||
<ul>
|
||||
<li>
|
||||
<p>spring-cloud-netflix-archaius</p>
|
||||
</li>
|
||||
<li>
|
||||
<p>spring-cloud-netflix-concurrency-limits</p>
|
||||
</li>
|
||||
<li>
|
||||
<p>spring-cloud-netflix-hystrix-contract</p>
|
||||
</li>
|
||||
<li>
|
||||
<p>spring-cloud-netflix-hystrix-dashboard</p>
|
||||
</li>
|
||||
<li>
|
||||
<p>spring-cloud-netflix-hystrix-stream</p>
|
||||
</li>
|
||||
<li>
|
||||
<p>spring-cloud-netflix-hystrix</p>
|
||||
</li>
|
||||
<li>
|
||||
<p>spring-cloud-netflix-ribbon</p>
|
||||
</li>
|
||||
<li>
|
||||
<p>spring-cloud-netflix-turbine-stream</p>
|
||||
</li>
|
||||
<li>
|
||||
<p>spring-cloud-netflix-turbine</p>
|
||||
</li>
|
||||
<li>
|
||||
<p>spring-cloud-netflix-zuul</p>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="admonitionblock note">
|
||||
<table>
|
||||
<tr>
|
||||
<td class="icon">
|
||||
<i class="fa icon-note" title="Note"></i>
|
||||
</td>
|
||||
<td class="content">
|
||||
This does not include the Eureka modules.
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="sect1">
|
||||
<h2 id="building"><a class="anchor" href="#building"></a><a class="link" href="#building">3. Building</a></h2>
|
||||
<div class="sectionbody">
|
||||
<div class="sect2">
|
||||
<h3 id="basic-compile-and-test"><a class="anchor" href="#basic-compile-and-test"></a><a class="link" href="#basic-compile-and-test">3.1. Basic Compile and Test</a></h3>
|
||||
<div class="paragraph">
|
||||
<p>To build the source you will need to install JDK 1.8.</p>
|
||||
</div>
|
||||
<div class="paragraph">
|
||||
<p>Spring Cloud uses Maven for most build-related activities, and you
|
||||
should be able to get off the ground quite quickly by cloning the
|
||||
project you are interested in and typing</p>
|
||||
</div>
|
||||
<div class="listingblock">
|
||||
<div class="content">
|
||||
<pre>$ ./mvnw install</pre>
|
||||
</div>
|
||||
</div>
|
||||
<div class="admonitionblock note">
|
||||
<table>
|
||||
<tr>
|
||||
<td class="icon">
|
||||
<i class="fa icon-note" title="Note"></i>
|
||||
</td>
|
||||
<td class="content">
|
||||
You can also install Maven (>=3.3.3) yourself and run the <code>mvn</code> command
|
||||
in place of <code>./mvnw</code> in the examples below. If you do that you also
|
||||
might need to add <code>-P spring</code> if your local Maven settings do not
|
||||
contain repository declarations for spring pre-release artifacts.
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
<div class="admonitionblock note">
|
||||
<table>
|
||||
<tr>
|
||||
<td class="icon">
|
||||
<i class="fa icon-note" title="Note"></i>
|
||||
</td>
|
||||
<td class="content">
|
||||
Be aware that you might need to increase the amount of memory
|
||||
available to Maven by setting a <code>MAVEN_OPTS</code> environment variable with
|
||||
a value like <code>-Xmx512m -XX:MaxPermSize=128m</code>. We try to cover this in
|
||||
the <code>.mvn</code> configuration, so if you find you have to do it to make a
|
||||
build succeed, please raise a ticket to get the settings added to
|
||||
source control.
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
<div class="paragraph">
|
||||
<p>For hints on how to build the project look in <code>.travis.yml</code> if there
|
||||
is one. There should be a "script" and maybe "install" command. Also
|
||||
look at the "services" section to see if any services need to be
|
||||
running locally (e.g. mongo or rabbit). Ignore the git-related bits
|
||||
that you might find in "before_install" since they’re related to setting git
|
||||
credentials and you already have those.</p>
|
||||
</div>
|
||||
<div class="paragraph">
|
||||
<p>The projects that require middleware generally include a
|
||||
<code>docker-compose.yml</code>, so consider using
|
||||
<a href="https://docs.docker.com/compose/">Docker Compose</a> to run the middeware servers
|
||||
in Docker containers. See the README in the
|
||||
<a href="https://github.com/spring-cloud-samples/scripts">scripts demo
|
||||
repository</a> for specific instructions about the common cases of mongo,
|
||||
rabbit and redis.</p>
|
||||
</div>
|
||||
<div class="admonitionblock note">
|
||||
<table>
|
||||
<tr>
|
||||
<td class="icon">
|
||||
<i class="fa icon-note" title="Note"></i>
|
||||
</td>
|
||||
<td class="content">
|
||||
If all else fails, build with the command from <code>.travis.yml</code> (usually
|
||||
<code>./mvnw install</code>).
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
<div class="sect2">
|
||||
<h3 id="documentation"><a class="anchor" href="#documentation"></a><a class="link" href="#documentation">3.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
|
||||
<code>src/main/asciidoc</code>. As part of that process it will look for a
|
||||
<code>README.adoc</code> and process it by loading all the includes, but not
|
||||
parsing or rendering it, just copying it to <code>${main.basedir}</code>
|
||||
(defaults to <code>${basedir}</code>, i.e. the root of the project). If there are
|
||||
any changes in the README it will then show up after a Maven build as
|
||||
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="anchor" href="#working-with-the-code"></a><a class="link" href="#working-with-the-code">3.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
|
||||
<a href="https://eclipse.org">Eclipse</a> when working with the code. We use the
|
||||
<a href="https://eclipse.org/m2e/">m2eclipse</a> eclipse plugin for maven support. Other IDEs and tools
|
||||
should also work without issue as long as they use Maven 3.3.3 or better.</p>
|
||||
</div>
|
||||
<div class="sect3">
|
||||
<h4 id="activate-the-spring-maven-profile"><a class="anchor" href="#activate-the-spring-maven-profile"></a><a class="link" href="#activate-the-spring-maven-profile">3.3.1. Activate the Spring Maven profile</a></h4>
|
||||
<div class="paragraph">
|
||||
<p>Spring Cloud projects require the 'spring' Maven profile to be activated to resolve
|
||||
the spring milestone and snapshot repositories. Use your preferred IDE to set this
|
||||
profile to be active, or you may experience build errors.</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="sect3">
|
||||
<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">3.3.2. 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
|
||||
marketplace".</p>
|
||||
</div>
|
||||
<div class="admonitionblock note">
|
||||
<table>
|
||||
<tr>
|
||||
<td class="icon">
|
||||
<i class="fa icon-note" title="Note"></i>
|
||||
</td>
|
||||
<td class="content">
|
||||
Older versions of m2e do not support Maven 3.3, so once the
|
||||
projects are imported into Eclipse you will also need to tell
|
||||
m2eclipse to use the right profile for the projects. If you
|
||||
see many different errors related to the POMs in the projects, check
|
||||
that you have an up to date installation. If you can’t upgrade m2e,
|
||||
add the "spring" profile to your <code>settings.xml</code>. Alternatively you can
|
||||
copy the repository settings from the "spring" profile of the parent
|
||||
pom into your <code>settings.xml</code>.
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
<div class="sect3">
|
||||
<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">3.3.3. 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>
|
||||
</div>
|
||||
<div class="listingblock">
|
||||
<div class="content">
|
||||
<pre>$ ./mvnw eclipse:eclipse</pre>
|
||||
</div>
|
||||
</div>
|
||||
<div class="paragraph">
|
||||
<p>The generated eclipse projects can be imported by selecting <code>import existing projects</code>
|
||||
from the <code>file</code> menu.</p>
|
||||
</div>
|
||||
<div class="admonitionblock note">
|
||||
<table>
|
||||
<tr>
|
||||
<td class="icon">
|
||||
<i class="fa icon-note" title="Note"></i>
|
||||
</td>
|
||||
<td class="content">
|
||||
To build the module <code>spring-cloud-netflix-hystrix-contract</code> along with the entire Netflix project run the
|
||||
<code>build.sh</code> script in the <code>scripts</code> directory.
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="sect1">
|
||||
<h2 id="contributing"><a class="anchor" href="#contributing"></a><a class="link" href="#contributing">4. Contributing</a></h2>
|
||||
<div class="sectionbody">
|
||||
<div class="paragraph">
|
||||
<p>Spring Cloud is released under the non-restrictive Apache 2.0 license,
|
||||
and follows a very standard Github development process, using Github
|
||||
tracker for issues and merging pull requests into master. If you want
|
||||
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="anchor" href="#sign-the-contributor-license-agreement"></a><a class="link" href="#sign-the-contributor-license-agreement">4.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>.
|
||||
Signing the contributor’s agreement does not grant anyone commit rights to the main
|
||||
repository, but it does mean that we can accept your contributions, and you will get an
|
||||
author credit if we do. Active contributors might be asked to join the core team, and
|
||||
given the ability to merge pull requests.</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="sect2">
|
||||
<h3 id="code-of-conduct"><a class="anchor" href="#code-of-conduct"></a><a class="link" href="#code-of-conduct">4.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
|
||||
unacceptable behavior to <a href="mailto:spring-code-of-conduct@pivotal.io">spring-code-of-conduct@pivotal.io</a>.</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="sect2">
|
||||
<h3 id="code-conventions-and-housekeeping"><a class="anchor" href="#code-conventions-and-housekeeping"></a><a class="link" href="#code-conventions-and-housekeeping">4.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>
|
||||
</div>
|
||||
<div class="ulist">
|
||||
<ul>
|
||||
<li>
|
||||
<p>Use the Spring Framework code format conventions. If you use Eclipse
|
||||
you can import formatter settings using the
|
||||
<code>eclipse-code-formatter.xml</code> file from the
|
||||
<a href="https://raw.githubusercontent.com/spring-cloud/spring-cloud-build/master/spring-cloud-dependencies-parent/eclipse-code-formatter.xml">Spring
|
||||
Cloud Build</a> project. If using IntelliJ, you can use the
|
||||
<a href="https://plugins.jetbrains.com/plugin/6546">Eclipse Code Formatter
|
||||
Plugin</a> to import the same file.</p>
|
||||
</li>
|
||||
<li>
|
||||
<p>Make sure all new <code>.java</code> files to have a simple Javadoc class comment with at least an
|
||||
<code>@author</code> tag identifying you, and preferably at least a paragraph on what the class is
|
||||
for.</p>
|
||||
</li>
|
||||
<li>
|
||||
<p>Add the ASF license header comment to all new <code>.java</code> files (copy from existing files
|
||||
in the project)</p>
|
||||
</li>
|
||||
<li>
|
||||
<p>Add yourself as an <code>@author</code> to the .java files that you modify substantially (more
|
||||
than cosmetic changes).</p>
|
||||
</li>
|
||||
<li>
|
||||
<p>Add some Javadocs and, if you change the namespace, some XSD doc elements.</p>
|
||||
</li>
|
||||
<li>
|
||||
<p>A few unit tests would help a lot as well — someone has to do it.</p>
|
||||
</li>
|
||||
<li>
|
||||
<p>If no-one else is using your branch, please rebase it against the current master (or
|
||||
other target branch in the main project).</p>
|
||||
</li>
|
||||
<li>
|
||||
<p>When writing a commit message please follow <a href="https://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html">these conventions</a>,
|
||||
if you are fixing an existing issue please add <code>Fixes gh-XXXX</code> at the end of the commit
|
||||
message (where XXXX is the issue number).</p>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div class="sect2">
|
||||
<h3 id="checkstyle"><a class="anchor" href="#checkstyle"></a><a class="link" href="#checkstyle">4.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>
|
||||
<div class="listingblock">
|
||||
<div class="title">spring-cloud-build-tools/</div>
|
||||
<div class="content">
|
||||
<pre>└── src
|
||||
├── checkstyle
|
||||
│ └── checkstyle-suppressions.xml <i class="conum" data-value="3"></i><b>(3)</b>
|
||||
└── main
|
||||
└── resources
|
||||
├── checkstyle-header.txt <i class="conum" data-value="2"></i><b>(2)</b>
|
||||
└── checkstyle.xml <i class="conum" data-value="1"></i><b>(1)</b></pre>
|
||||
</div>
|
||||
</div>
|
||||
<div class="colist arabic">
|
||||
<table>
|
||||
<tr>
|
||||
<td><i class="conum" data-value="1"></i><b>1</b></td>
|
||||
<td>Default Checkstyle rules</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><i class="conum" data-value="2"></i><b>2</b></td>
|
||||
<td>File header setup</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><i class="conum" data-value="3"></i><b>3</b></td>
|
||||
<td>Default suppression rules</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
<div class="sect3">
|
||||
<h4 id="checkstyle-configuration"><a class="anchor" href="#checkstyle-configuration"></a><a class="link" href="#checkstyle-configuration">4.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>
|
||||
<div class="listingblock">
|
||||
<div class="title">pom.xml</div>
|
||||
<div class="content">
|
||||
<pre><properties>
|
||||
<maven-checkstyle-plugin.failsOnError>true</maven-checkstyle-plugin.failsOnError> <i class="conum" data-value="1"></i><b>(1)</b>
|
||||
<maven-checkstyle-plugin.failsOnViolation>true
|
||||
</maven-checkstyle-plugin.failsOnViolation> <i class="conum" data-value="2"></i><b>(2)</b>
|
||||
<maven-checkstyle-plugin.includeTestSourceDirectory>true
|
||||
</maven-checkstyle-plugin.includeTestSourceDirectory> <i class="conum" data-value="3"></i><b>(3)</b>
|
||||
</properties>
|
||||
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin> <i class="conum" data-value="4"></i><b>(4)</b>
|
||||
<groupId>io.spring.javaformat</groupId>
|
||||
<artifactId>spring-javaformat-maven-plugin</artifactId>
|
||||
</plugin>
|
||||
<plugin> <i class="conum" data-value="5"></i><b>(5)</b>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-checkstyle-plugin</artifactId>
|
||||
</plugin>
|
||||
</plugins>
|
||||
|
||||
<reporting>
|
||||
<plugins>
|
||||
<plugin> <i class="conum" data-value="5"></i><b>(5)</b>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-checkstyle-plugin</artifactId>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</reporting>
|
||||
</build></pre>
|
||||
</div>
|
||||
</div>
|
||||
<div class="colist arabic">
|
||||
<table>
|
||||
<tr>
|
||||
<td><i class="conum" data-value="1"></i><b>1</b></td>
|
||||
<td>Fails the build upon Checkstyle errors</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><i class="conum" data-value="2"></i><b>2</b></td>
|
||||
<td>Fails the build upon Checkstyle violations</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><i class="conum" data-value="3"></i><b>3</b></td>
|
||||
<td>Checkstyle analyzes also the test sources</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><i class="conum" data-value="4"></i><b>4</b></td>
|
||||
<td>Add the Spring Java Format plugin that will reformat your code to pass most of the Checkstyle formatting rules</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><i class="conum" data-value="5"></i><b>5</b></td>
|
||||
<td>Add checkstyle plugin to your build and reporting phases</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
<div class="paragraph">
|
||||
<p>If you need to suppress some rules (e.g. line length needs to be longer), then it’s enough for you to define a file under <code>${project.root}/src/checkstyle/checkstyle-suppressions.xml</code> with your suppressions. Example:</p>
|
||||
</div>
|
||||
<div class="listingblock">
|
||||
<div class="title">projectRoot/src/checkstyle/checkstyle-suppresions.xml</div>
|
||||
<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">
|
||||
<suppressions>
|
||||
<suppress files=".*ConfigServerApplication\.java" checks="HideUtilityClassConstructor"/>
|
||||
<suppress files=".*ConfigClientWatch\.java" checks="LineLengthCheck"/>
|
||||
</suppressions></pre>
|
||||
</div>
|
||||
</div>
|
||||
<div class="paragraph">
|
||||
<p>It’s advisable to copy the <code>${spring-cloud-build.rootFolder}/.editorconfig</code> and <code>${spring-cloud-build.rootFolder}/.springformat</code> to your project. That way, some default formatting rules will be applied. You can do so by running this script:</p>
|
||||
</div>
|
||||
<div class="listingblock">
|
||||
<div class="content">
|
||||
<pre class="highlightjs highlight"><code class="language-bash hljs" data-lang="bash">$ curl https://raw.githubusercontent.com/spring-cloud/spring-cloud-build/master/.editorconfig -o .editorconfig
|
||||
$ touch .springformat</code></pre>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="sect2">
|
||||
<h3 id="ide-setup"><a class="anchor" href="#ide-setup"></a><a class="link" href="#ide-setup">4.5. IDE setup</a></h3>
|
||||
<div class="sect3">
|
||||
<h4 id="intellij-idea"><a class="anchor" href="#intellij-idea"></a><a class="link" href="#intellij-idea">4.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>
|
||||
</div>
|
||||
<div class="listingblock">
|
||||
<div class="title">spring-cloud-build-tools/</div>
|
||||
<div class="content">
|
||||
<pre>└── src
|
||||
├── checkstyle
|
||||
│ └── checkstyle-suppressions.xml <i class="conum" data-value="3"></i><b>(3)</b>
|
||||
└── main
|
||||
└── resources
|
||||
├── checkstyle-header.txt <i class="conum" data-value="2"></i><b>(2)</b>
|
||||
├── checkstyle.xml <i class="conum" data-value="1"></i><b>(1)</b>
|
||||
└── intellij
|
||||
├── Intellij_Project_Defaults.xml <i class="conum" data-value="4"></i><b>(4)</b>
|
||||
└── Intellij_Spring_Boot_Java_Conventions.xml <i class="conum" data-value="5"></i><b>(5)</b></pre>
|
||||
</div>
|
||||
</div>
|
||||
<div class="colist arabic">
|
||||
<table>
|
||||
<tr>
|
||||
<td><i class="conum" data-value="1"></i><b>1</b></td>
|
||||
<td>Default Checkstyle rules</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><i class="conum" data-value="2"></i><b>2</b></td>
|
||||
<td>File header setup</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><i class="conum" data-value="3"></i><b>3</b></td>
|
||||
<td>Default suppression rules</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><i class="conum" data-value="4"></i><b>4</b></td>
|
||||
<td>Project defaults for Intellij that apply most of Checkstyle rules</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><i class="conum" data-value="5"></i><b>5</b></td>
|
||||
<td>Project style conventions for Intellij that apply most of Checkstyle rules</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
<div class="imageblock">
|
||||
<div class="content">
|
||||
<img src="https://raw.githubusercontent.com/spring-cloud/spring-cloud-build/master/docs/src/main/asciidoc/images/intellij-code-style.png" alt="Code style">
|
||||
</div>
|
||||
<div class="title">Figure 1. Code style</div>
|
||||
</div>
|
||||
<div class="paragraph">
|
||||
<p>Go to <code>File</code> → <code>Settings</code> → <code>Editor</code> → <code>Code style</code>. There click on the icon next to the <code>Scheme</code> section. There, click on the <code>Import Scheme</code> value and pick the <code>Intellij IDEA code style XML</code> option. Import the <code>spring-cloud-build-tools/src/main/resources/intellij/Intellij_Spring_Boot_Java_Conventions.xml</code> file.</p>
|
||||
</div>
|
||||
<div class="imageblock">
|
||||
<div class="content">
|
||||
<img src="https://raw.githubusercontent.com/spring-cloud/spring-cloud-build/master/docs/src/main/asciidoc/images/intellij-inspections.png" alt="Code style">
|
||||
</div>
|
||||
<div class="title">Figure 2. Inspection profiles</div>
|
||||
</div>
|
||||
<div class="paragraph">
|
||||
<p>Go to <code>File</code> → <code>Settings</code> → <code>Editor</code> → <code>Inspections</code>. There click on the icon next to the <code>Profile</code> section. There, click on the <code>Import Profile</code> and import the <code>spring-cloud-build-tools/src/main/resources/intellij/Intellij_Project_Defaults.xml</code> file.</p>
|
||||
</div>
|
||||
<div class="paragraph">
|
||||
<div class="title">Checkstyle</div>
|
||||
<p>To have Intellij work with Checkstyle, you have to install the <code>Checkstyle</code> plugin. It’s advisable to also install the <code>Assertions2Assertj</code> to automatically convert the JUnit assertions</p>
|
||||
</div>
|
||||
<div class="imageblock">
|
||||
<div class="content">
|
||||
<img src="https://raw.githubusercontent.com/spring-cloud/spring-cloud-build/master/docs/src/main/asciidoc/images/intellij-checkstyle.png" alt="Checkstyle">
|
||||
</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">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">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">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>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="admonitionblock important">
|
||||
<table>
|
||||
<tr>
|
||||
<td class="icon">
|
||||
<i class="fa icon-important" title="Important"></i>
|
||||
</td>
|
||||
<td class="content">
|
||||
Remember to set the <code>Scan Scope</code> to <code>All sources</code> since we apply checkstyle rules for production and test sources.
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</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/github.min.css">
|
||||
<script src="js/highlight/highlight.min.js"></script>
|
||||
<script>hljs.initHighlighting()</script>
|
||||
</body>
|
||||
</html>
|
||||
242
spring-cloud-netflix/3.0.0-M2/reference/html/appendix.html
Normal file
@@ -0,0 +1,242 @@
|
||||
<!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.8">
|
||||
<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};
|
||||
}
|
||||
|
||||
function globalSwitch() {
|
||||
$('.switch--item').each(function() {
|
||||
$(this).off('click');
|
||||
$(this).on('click', function() {
|
||||
selectedText = $(this).text()
|
||||
selectedIndex = $(this).index()
|
||||
$(".switch--item").filter(function() { return ($(this).text() === selectedText) }).each(function() {
|
||||
$(this).addClass('selected');
|
||||
$(this).siblings().removeClass('selected');
|
||||
selectedContent = $(this).parent().siblings(".content").eq(selectedIndex)
|
||||
selectedContent.removeClass('hidden');
|
||||
selectedContent.siblings().addClass('hidden');
|
||||
});
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
$(addBlockSwitches);
|
||||
$(globalSwitch);
|
||||
|
||||
</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 Netflix 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">eureka.client.eureka-connection-idle-timeout-seconds</p></td>
|
||||
<td class="tableblock halign-left valign-top"><p class="tableblock">30</p></td>
|
||||
<td class="tableblock halign-left valign-top"><p class="tableblock">Indicates how much time (in seconds) that the HTTP connections to eureka server can stay idle before it can be closed. In the AWS environment, it is recommended that the values is 30 seconds or less, since the firewall cleans up the connection information after a few mins leaving the connection hanging in limbo.</p></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="tableblock halign-left valign-top"><p class="tableblock">eureka.client.eureka-server-connect-timeout-seconds</p></td>
|
||||
<td class="tableblock halign-left valign-top"><p class="tableblock">5</p></td>
|
||||
<td class="tableblock halign-left valign-top"><p class="tableblock">Indicates how long to wait (in seconds) before a connection to eureka server needs to timeout. Note that the connections in the client are pooled by org.apache.http.client.HttpClient and this setting affects the actual connection creation and also the wait time to get the connection from the pool.</p></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="tableblock halign-left valign-top"><p class="tableblock">eureka.client.eureka-server-d-n-s-name</p></td>
|
||||
<td class="tableblock halign-left valign-top"></td>
|
||||
<td class="tableblock halign-left valign-top"><p class="tableblock">Gets the DNS name to be queried to get the list of eureka servers.This information is not required if the contract returns the service urls by implementing serviceUrls. The DNS mechanism is used when useDnsForFetchingServiceUrls is set to true and the eureka client expects the DNS to configured a certain way so that it can fetch changing eureka servers dynamically. The changes are effective at runtime.</p></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="tableblock halign-left valign-top"><p class="tableblock">eureka.client.eureka-server-port</p></td>
|
||||
<td class="tableblock halign-left valign-top"></td>
|
||||
<td class="tableblock halign-left valign-top"><p class="tableblock">Gets the port to be used to construct the service url to contact eureka server when the list of eureka servers come from the DNS.This information is not required if the contract returns the service urls eurekaServerServiceUrls(String). The DNS mechanism is used when useDnsForFetchingServiceUrls is set to true and the eureka client expects the DNS to configured a certain way so that it can fetch changing eureka servers dynamically. The changes are effective at runtime.</p></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="tableblock halign-left valign-top"><p class="tableblock">eureka.client.eureka-server-read-timeout-seconds</p></td>
|
||||
<td class="tableblock halign-left valign-top"><p class="tableblock">8</p></td>
|
||||
<td class="tableblock halign-left valign-top"><p class="tableblock">Indicates how long to wait (in seconds) before a read from eureka server needs to timeout.</p></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="tableblock halign-left valign-top"><p class="tableblock">eureka.client.eureka-server-total-connections</p></td>
|
||||
<td class="tableblock halign-left valign-top"><p class="tableblock">200</p></td>
|
||||
<td class="tableblock halign-left valign-top"><p class="tableblock">Gets the total number of connections that is allowed from eureka client to all eureka servers.</p></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="tableblock halign-left valign-top"><p class="tableblock">eureka.client.eureka-server-total-connections-per-host</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">Gets the total number of connections that is allowed from eureka client to a eureka server host.</p></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="tableblock halign-left valign-top"><p class="tableblock">eureka.client.eureka-server-u-r-l-context</p></td>
|
||||
<td class="tableblock halign-left valign-top"></td>
|
||||
<td class="tableblock halign-left valign-top"><p class="tableblock">Gets the URL context to be used to construct the service url to contact eureka server when the list of eureka servers come from the DNS. This information is not required if the contract returns the service urls from eurekaServerServiceUrls. The DNS mechanism is used when useDnsForFetchingServiceUrls is set to true and the eureka client expects the DNS to configured a certain way so that it can fetch changing eureka servers dynamically. The changes are effective at runtime.</p></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="tableblock halign-left valign-top"><p class="tableblock">eureka.client.eureka-service-url-poll-interval-seconds</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">Indicates how often(in seconds) to poll for changes to eureka server information. Eureka servers could be added or removed and this setting controls how soon the eureka clients should know about it.</p></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="tableblock halign-left valign-top"><p class="tableblock">eureka.client.prefer-same-zone-eureka</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">Indicates whether or not this instance should try to use the eureka server in the same zone for latency and/or other reason. Ideally eureka clients are configured to talk to servers in the same zone The changes are effective at runtime at the next registry fetch cycle as specified by registryFetchIntervalSeconds</p></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="tableblock halign-left valign-top"><p class="tableblock">eureka.client.register-with-eureka</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">Indicates whether or not this instance should register its information with eureka server for discovery by others. In some cases, you do not want your instances to be discovered whereas you just want do discover other instances.</p></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="tableblock halign-left valign-top"><p class="tableblock">eureka.server.peer-eureka-nodes-update-interval-ms</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">null</p></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="tableblock halign-left valign-top"><p class="tableblock">eureka.server.peer-eureka-status-refresh-time-interval-ms</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">null</p></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="tableblock halign-left valign-top"><p class="tableblock">ribbon.eureka.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">Enables the use of Eureka with Ribbon.</p></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="tableblock halign-left valign-top"><p class="tableblock">spring.cloud.loadbalancer.eureka.approximate-zone-from-hostname</p></td>
|
||||
<td class="tableblock halign-left valign-top"><p class="tableblock">false</p></td>
|
||||
<td class="tableblock halign-left valign-top"><p class="tableblock">Used to determine whether we should try to get the <code>zone</code> value from host name.</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/github.min.css">
|
||||
<script src="js/highlight/highlight.min.js"></script>
|
||||
<script>hljs.initHighlighting()</script>
|
||||
</body>
|
||||
</html>
|
||||
BIN
spring-cloud-netflix/3.0.0-M2/reference/html/favicon.ico
Normal file
|
After Width: | Height: | Size: 109 KiB |
BIN
spring-cloud-netflix/3.0.0-M2/reference/html/images/Hystrix.png
Normal file
|
After Width: | Height: | Size: 225 KiB |
|
After Width: | Height: | Size: 44 KiB |
|
After Width: | Height: | Size: 39 KiB |
|
After Width: | Height: | Size: 14 KiB |
938
spring-cloud-netflix/3.0.0-M2/reference/html/index.html
Normal file
@@ -0,0 +1,938 @@
|
||||
<!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.8">
|
||||
<title>Spring Cloud Netflix</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};
|
||||
}
|
||||
|
||||
function globalSwitch() {
|
||||
$('.switch--item').each(function() {
|
||||
$(this).off('click');
|
||||
$(this).on('click', function() {
|
||||
selectedText = $(this).text()
|
||||
selectedIndex = $(this).index()
|
||||
$(".switch--item").filter(function() { return ($(this).text() === selectedText) }).each(function() {
|
||||
$(this).addClass('selected');
|
||||
$(this).siblings().removeClass('selected');
|
||||
selectedContent = $(this).parent().siblings(".content").eq(selectedIndex)
|
||||
selectedContent.removeClass('hidden');
|
||||
selectedContent.siblings().addClass('hidden');
|
||||
});
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
$(addBlockSwitches);
|
||||
$(globalSwitch);
|
||||
|
||||
</script>
|
||||
|
||||
</head>
|
||||
<body class="book toc2 toc-left">
|
||||
<div id="header">
|
||||
<h1>Spring Cloud Netflix</h1>
|
||||
<div id="toc" class="toc2">
|
||||
<div id="toctitle">Table of Contents</div>
|
||||
<ul class="sectlevel1">
|
||||
<li><a href="#service-discovery-eureka-clients">1. Service Discovery: Eureka Clients</a>
|
||||
<ul class="sectlevel2">
|
||||
<li><a href="#netflix-eureka-client-starter">1.1. How to Include Eureka Client</a></li>
|
||||
<li><a href="#registering-with-eureka">1.2. Registering with Eureka</a></li>
|
||||
<li><a href="#authenticating-with-the-eureka-server">1.3. Authenticating with the Eureka Server</a></li>
|
||||
<li><a href="#status-page-and-health-indicator">1.4. Status Page and Health Indicator</a></li>
|
||||
<li><a href="#registering-a-secure-application">1.5. Registering a Secure Application</a></li>
|
||||
<li><a href="#eurekas-health-checks">1.6. Eureka’s Health Checks</a></li>
|
||||
<li><a href="#eureka-metadata-for-instances-and-clients">1.7. Eureka Metadata for Instances and Clients</a>
|
||||
<ul class="sectlevel3">
|
||||
<li><a href="#using-eureka-on-cloud-foundry">1.7.1. Using Eureka on Cloud Foundry</a></li>
|
||||
<li><a href="#using-eureka-on-aws">1.7.2. Using Eureka on AWS</a></li>
|
||||
<li><a href="#changing-the-eureka-instance-id">1.7.3. Changing the Eureka Instance ID</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li><a href="#using-the-eurekaclient">1.8. Using the EurekaClient</a>
|
||||
<ul class="sectlevel3">
|
||||
<li><a href="#eurekaclient-without-jersey">1.8.1. EurekaClient without Jersey</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li><a href="#alternatives-to-the-native-netflix-eurekaclient">1.9. Alternatives to the Native Netflix EurekaClient</a></li>
|
||||
<li><a href="#why-is-it-so-slow-to-register-a-service">1.10. Why Is It so Slow to Register a Service?</a></li>
|
||||
<li><a href="#zones">1.11. Zones</a></li>
|
||||
<li><a href="#refreshing-eureka-clients">1.12. Refreshing Eureka Clients</a></li>
|
||||
<li><a href="#using-eureka-with-spring-cloud-loadbalancer">1.13. Using Eureka with Spring Cloud LoadBalancer</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li><a href="#spring-cloud-eureka-server">2. Service Discovery: Eureka Server</a>
|
||||
<ul class="sectlevel2">
|
||||
<li><a href="#netflix-eureka-server-starter">2.1. How to Include Eureka Server</a></li>
|
||||
<li><a href="#spring-cloud-running-eureka-server">2.2. How to Run a Eureka Server</a></li>
|
||||
<li><a href="#spring-cloud-eureka-server-zones-and-regions">2.3. High Availability, Zones and Regions</a></li>
|
||||
<li><a href="#spring-cloud-eureka-server-standalone-mode">2.4. Standalone Mode</a></li>
|
||||
<li><a href="#spring-cloud-eureka-server-peer-awareness">2.5. Peer Awareness</a></li>
|
||||
<li><a href="#spring-cloud-eureka-server-prefer-ip-address">2.6. When to Prefer IP Address</a></li>
|
||||
<li><a href="#securing-the-eureka-server">2.7. Securing The Eureka Server</a></li>
|
||||
<li><a href="#jdk-11-support">2.8. JDK 11 Support</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li><a href="#configuration-properties">3. Configuration properties</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div id="content">
|
||||
<div id="preamble">
|
||||
<div class="sectionbody">
|
||||
<div class="paragraph">
|
||||
<p><strong>3.0.0-M2</strong></p>
|
||||
</div>
|
||||
<div class="paragraph">
|
||||
<p>This project provides Netflix OSS 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 battle-tested Netflix components. The
|
||||
patterns provided include Service Discovery (Eureka), Circuit Breaker (Hystrix),
|
||||
Intelligent Routing (Zuul) and Client Side Load Balancing (Ribbon).</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="sect1">
|
||||
<h2 id="service-discovery-eureka-clients"><a class="anchor" href="#service-discovery-eureka-clients"></a><a class="link" href="#service-discovery-eureka-clients">1. Service Discovery: Eureka Clients</a></h2>
|
||||
<div class="sectionbody">
|
||||
<div class="paragraph">
|
||||
<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 difficult to do and can be brittle.
|
||||
Eureka is the Netflix Service Discovery Server and Client.
|
||||
The server can be configured and deployed to be highly available, with each server replicating state about the registered services to the others.</p>
|
||||
</div>
|
||||
<div class="sect2">
|
||||
<h3 id="netflix-eureka-client-starter"><a class="anchor" href="#netflix-eureka-client-starter"></a><a class="link" href="#netflix-eureka-client-starter">1.1. How to Include Eureka Client</a></h3>
|
||||
<div class="paragraph">
|
||||
<p>To include the Eureka Client in your project, use the starter with a group ID of <code>org.springframework.cloud</code> and an artifact ID of <code>spring-cloud-starter-netflix-eureka-client</code>.
|
||||
See the <a href="https://projects.spring.io/spring-cloud/">Spring Cloud Project page</a> for details on setting up your build system with the current Spring Cloud Release Train.</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="sect2">
|
||||
<h3 id="registering-with-eureka"><a class="anchor" href="#registering-with-eureka"></a><a class="link" href="#registering-with-eureka">1.2. Registering with Eureka</a></h3>
|
||||
<div class="paragraph">
|
||||
<p>When a client registers with Eureka, it provides meta-data about itself — such as host, port, health indicator URL, home page, and other details.
|
||||
Eureka receives heartbeat messages from each instance belonging to a service.
|
||||
If the heartbeat fails over a configurable timetable, the instance is normally removed from the registry.</p>
|
||||
</div>
|
||||
<div class="paragraph">
|
||||
<p>The following example shows a minimal Eureka client application:</p>
|
||||
</div>
|
||||
<div class="listingblock">
|
||||
<div class="content">
|
||||
<pre class="highlightjs highlight"><code class="language-java hljs" data-lang="java">@SpringBootApplication
|
||||
@RestController
|
||||
public class Application {
|
||||
|
||||
@RequestMapping("/")
|
||||
public String home() {
|
||||
return "Hello world";
|
||||
}
|
||||
|
||||
public static void main(String[] args) {
|
||||
new SpringApplicationBuilder(Application.class).web(true).run(args);
|
||||
}
|
||||
|
||||
}</code></pre>
|
||||
</div>
|
||||
</div>
|
||||
<div class="paragraph">
|
||||
<p>Note that the preceding example shows a normal <a href="https://projects.spring.io/spring-boot/">Spring Boot</a> application.
|
||||
By having <code>spring-cloud-starter-netflix-eureka-client</code> on the classpath, your application automatically registers with the Eureka Server. Configuration is required to locate the Eureka server, as shown in the following example:</p>
|
||||
</div>
|
||||
<div class="listingblock">
|
||||
<div class="title">application.yml</div>
|
||||
<div class="content">
|
||||
<pre>eureka:
|
||||
client:
|
||||
serviceUrl:
|
||||
defaultZone: http://localhost:8761/eureka/</pre>
|
||||
</div>
|
||||
</div>
|
||||
<div class="paragraph">
|
||||
<p>In the preceding example, <code>defaultZone</code> is a magic string fallback value that provides the service URL for any client that does not express a preference (in other words, it is a useful default).</p>
|
||||
</div>
|
||||
<div class="admonitionblock warning">
|
||||
<table>
|
||||
<tr>
|
||||
<td class="icon">
|
||||
<i class="fa icon-warning" title="Warning"></i>
|
||||
</td>
|
||||
<td class="content">
|
||||
The <code>defaultZone</code> property is case sensitive and requires camel case because the <code>serviceUrl</code> property is a <code>Map<String, String></code>. Therefore, the <code>defaultZone</code> property does not follow the normal Spring Boot snake-case convention of <code>default-zone</code>.
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
<div class="paragraph">
|
||||
<p>The default application name (that is, the service ID), virtual host, and non-secure port (taken from the <code>Environment</code>) are <code>${spring.application.name}</code>, <code>${spring.application.name}</code> and <code>${server.port}</code>, respectively.</p>
|
||||
</div>
|
||||
<div class="paragraph">
|
||||
<p>Having <code>spring-cloud-starter-netflix-eureka-client</code> on the classpath makes the app into both a Eureka “instance” (that is, it registers itself) and a “client” (it can query the registry to locate other services).
|
||||
The instance behaviour is driven by <code>eureka.instance.*</code> configuration keys, but the defaults are fine if you ensure that your application has a value for <code>spring.application.name</code> (this is the default for the Eureka service ID or VIP).</p>
|
||||
</div>
|
||||
<div class="paragraph">
|
||||
<p>See <a href="https://github.com/spring-cloud/spring-cloud-netflix/tree/master/spring-cloud-netflix-eureka-client/src/main/java/org/springframework/cloud/netflix/eureka/EurekaInstanceConfigBean.java">EurekaInstanceConfigBean</a> and <a href="https://github.com/spring-cloud/spring-cloud-netflix/tree/master/spring-cloud-netflix-eureka-client/src/main/java/org/springframework/cloud/netflix/eureka/EurekaClientConfigBean.java">EurekaClientConfigBean</a> for more details on the configurable options.</p>
|
||||
</div>
|
||||
<div class="paragraph">
|
||||
<p>To disable the Eureka Discovery Client, you can set <code>eureka.client.enabled</code> to <code>false</code>. Eureka Discovery Client will also be disabled when <code>spring.cloud.discovery.enabled</code> is set to <code>false</code>.</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="sect2">
|
||||
<h3 id="authenticating-with-the-eureka-server"><a class="anchor" href="#authenticating-with-the-eureka-server"></a><a class="link" href="#authenticating-with-the-eureka-server">1.3. Authenticating with the Eureka Server</a></h3>
|
||||
<div class="paragraph">
|
||||
<p>HTTP basic authentication is automatically added to your eureka client if one of the <code>eureka.client.serviceUrl.defaultZone</code> URLs has credentials embedded in it (curl style, as follows: <code><a href="https://user:password@localhost:8761/eureka" class="bare">user:password@localhost:8761/eureka</a></code>).
|
||||
For more complex needs, you can create a <code>@Bean</code> of type <code>DiscoveryClientOptionalArgs</code> and inject <code>ClientFilter</code> instances into it, all of which is applied to the calls from the client to the server.</p>
|
||||
</div>
|
||||
<div class="admonitionblock note">
|
||||
<table>
|
||||
<tr>
|
||||
<td class="icon">
|
||||
<i class="fa icon-note" title="Note"></i>
|
||||
</td>
|
||||
<td class="content">
|
||||
Because of a limitation in Eureka, it is not possible to support per-server basic auth credentials, so only the first set that are found is used.
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
<div class="sect2">
|
||||
<h3 id="status-page-and-health-indicator"><a class="anchor" href="#status-page-and-health-indicator"></a><a class="link" href="#status-page-and-health-indicator">1.4. Status Page and Health Indicator</a></h3>
|
||||
<div class="paragraph">
|
||||
<p>The status page and health indicators for a Eureka instance default to <code>/info</code> and <code>/health</code> respectively, which are the default locations of useful endpoints in a Spring Boot Actuator application.
|
||||
You need to change these, even for an Actuator application if you use a non-default context path or servlet path (such as <code>server.servletPath=/custom</code>). The following example shows the default values for the two settings:</p>
|
||||
</div>
|
||||
<div class="listingblock">
|
||||
<div class="title">application.yml</div>
|
||||
<div class="content">
|
||||
<pre>eureka:
|
||||
instance:
|
||||
statusPageUrlPath: ${server.servletPath}/info
|
||||
healthCheckUrlPath: ${server.servletPath}/health</pre>
|
||||
</div>
|
||||
</div>
|
||||
<div class="paragraph">
|
||||
<p>These links show up in the metadata that is consumed by clients and are used in some scenarios to decide whether to send requests to your application, so it is helpful if they are accurate.</p>
|
||||
</div>
|
||||
<div class="admonitionblock note">
|
||||
<table>
|
||||
<tr>
|
||||
<td class="icon">
|
||||
<i class="fa icon-note" title="Note"></i>
|
||||
</td>
|
||||
<td class="content">
|
||||
In Dalston it was also required to set the status and health check URLs when changing
|
||||
that management context path. This requirement was removed beginning in Edgware.
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
<div class="sect2">
|
||||
<h3 id="registering-a-secure-application"><a class="anchor" href="#registering-a-secure-application"></a><a class="link" href="#registering-a-secure-application">1.5. Registering a Secure Application</a></h3>
|
||||
<div class="paragraph">
|
||||
<p>If your app wants to be contacted over HTTPS, you can set two flags in the <code>EurekaInstanceConfig</code>:</p>
|
||||
</div>
|
||||
<div class="ulist">
|
||||
<ul>
|
||||
<li>
|
||||
<p><code>eureka.instance.[nonSecurePortEnabled]=[false]</code></p>
|
||||
</li>
|
||||
<li>
|
||||
<p><code>eureka.instance.[securePortEnabled]=[true]</code></p>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="paragraph">
|
||||
<p>Doing so makes Eureka publish instance information that shows an explicit preference for secure communication.
|
||||
The Spring Cloud <code>DiscoveryClient</code> always returns a URI starting with <code>https</code> for a service configured this way.
|
||||
Similarly, when a service is configured this way, the Eureka (native) instance information has a secure health check URL.</p>
|
||||
</div>
|
||||
<div class="paragraph">
|
||||
<p>Because of the way Eureka works internally, it still publishes a non-secure URL for the status and home pages unless you also override those explicitly.
|
||||
You can use placeholders to configure the eureka instance URLs, as shown in the following example:</p>
|
||||
</div>
|
||||
<div class="listingblock">
|
||||
<div class="title">application.yml</div>
|
||||
<div class="content">
|
||||
<pre>eureka:
|
||||
instance:
|
||||
statusPageUrl: https://${eureka.hostname}/info
|
||||
healthCheckUrl: https://${eureka.hostname}/health
|
||||
homePageUrl: https://${eureka.hostname}/</pre>
|
||||
</div>
|
||||
</div>
|
||||
<div class="paragraph">
|
||||
<p>(Note that <code>${eureka.hostname}</code> is a native placeholder only available
|
||||
in later versions of Eureka. You could achieve the same thing with
|
||||
Spring placeholders as well — for example, by using <code>${eureka.instance.hostName}</code>.)</p>
|
||||
</div>
|
||||
<div class="admonitionblock note">
|
||||
<table>
|
||||
<tr>
|
||||
<td class="icon">
|
||||
<i class="fa icon-note" title="Note"></i>
|
||||
</td>
|
||||
<td class="content">
|
||||
If your application runs behind a proxy, and the SSL termination is in the proxy (for example, if you run in Cloud Foundry or other platforms as a service), then you need to ensure that the proxy “forwarded” headers are intercepted and handled by the application.
|
||||
If the Tomcat container embedded in a Spring Boot application has explicit configuration for the 'X-Forwarded-\*` headers, this happens automatically.
|
||||
The links rendered by your app to itself being wrong (the wrong host, port, or protocol) is a sign that you got this configuration wrong.
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
<div class="sect2">
|
||||
<h3 id="eurekas-health-checks"><a class="anchor" href="#eurekas-health-checks"></a><a class="link" href="#eurekas-health-checks">1.6. Eureka’s Health Checks</a></h3>
|
||||
<div class="paragraph">
|
||||
<p>By default, Eureka uses the client heartbeat to determine if a client is up.
|
||||
Unless specified otherwise, the Discovery Client does not propagate the current health check status of the application, per the Spring Boot Actuator.
|
||||
Consequently, after successful registration, Eureka always announces that the application is in 'UP' state. This behavior can be altered by enabling Eureka health checks, which results in propagating application status to Eureka.
|
||||
As a consequence, every other application does not send traffic to applications in states other then 'UP'.
|
||||
The following example shows how to enable health checks for the client:</p>
|
||||
</div>
|
||||
<div class="listingblock">
|
||||
<div class="title">application.yml</div>
|
||||
<div class="content">
|
||||
<pre>eureka:
|
||||
client:
|
||||
healthcheck:
|
||||
enabled: true</pre>
|
||||
</div>
|
||||
</div>
|
||||
<div class="admonitionblock warning">
|
||||
<table>
|
||||
<tr>
|
||||
<td class="icon">
|
||||
<i class="fa icon-warning" title="Warning"></i>
|
||||
</td>
|
||||
<td class="content">
|
||||
<code>eureka.client.healthcheck.enabled=true</code> should only be set in <code>application.yml</code>. Setting the value in <code>bootstrap.yml</code> causes undesirable side effects, such as registering in Eureka with an <code>UNKNOWN</code> status.
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
<div class="paragraph">
|
||||
<p>If you require more control over the health checks, consider implementing your own <code>com.netflix.appinfo.HealthCheckHandler</code>.</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="sect2">
|
||||
<h3 id="eureka-metadata-for-instances-and-clients"><a class="anchor" href="#eureka-metadata-for-instances-and-clients"></a><a class="link" href="#eureka-metadata-for-instances-and-clients">1.7. Eureka Metadata for Instances and Clients</a></h3>
|
||||
<div class="paragraph">
|
||||
<p>It is worth spending a bit of time understanding how the Eureka metadata works, so you can use it in a way that makes sense in your platform.
|
||||
There is standard metadata for information such as hostname, IP address, port numbers, the status page, and health check.
|
||||
These are published in the service registry and used by clients to contact the services in a straightforward way.
|
||||
Additional metadata can be added to the instance registration in the <code>eureka.instance.metadataMap</code>, and this metadata is accessible in the remote clients.
|
||||
In general, additional metadata does not change the behavior of the client, unless the client is made aware of the meaning of the metadata.
|
||||
There are a couple of special cases, described later in this document, where Spring Cloud already assigns meaning to the metadata map.</p>
|
||||
</div>
|
||||
<div class="sect3">
|
||||
<h4 id="using-eureka-on-cloud-foundry"><a class="anchor" href="#using-eureka-on-cloud-foundry"></a><a class="link" href="#using-eureka-on-cloud-foundry">1.7.1. Using Eureka on Cloud Foundry</a></h4>
|
||||
<div class="paragraph">
|
||||
<p>Cloud Foundry has a global router so that all instances of the same app have the same hostname (other PaaS solutions with a similar architecture have the same arrangement).
|
||||
This is not necessarily a barrier to using Eureka.
|
||||
However, if you use the router (recommended or even mandatory, depending on the way your platform was set up), you need to explicitly set the hostname and port numbers (secure or non-secure) so that they use the router.
|
||||
You might also want to use instance metadata so that you can distinguish between the instances on the client (for example, in a custom load balancer).
|
||||
By default, the <code>eureka.instance.instanceId</code> is <code>vcap.application.instance_id</code>, as shown in the following example:</p>
|
||||
</div>
|
||||
<div class="listingblock">
|
||||
<div class="title">application.yml</div>
|
||||
<div class="content">
|
||||
<pre>eureka:
|
||||
instance:
|
||||
hostname: ${vcap.application.uris[0]}
|
||||
nonSecurePort: 80</pre>
|
||||
</div>
|
||||
</div>
|
||||
<div class="paragraph">
|
||||
<p>Depending on the way the security rules are set up in your Cloud Foundry instance, you might be able to register and use the IP address of the host VM for direct service-to-service calls.
|
||||
This feature is not yet available on Pivotal Web Services (<a href="https://run.pivotal.io">PWS</a>).</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="sect3">
|
||||
<h4 id="using-eureka-on-aws"><a class="anchor" href="#using-eureka-on-aws"></a><a class="link" href="#using-eureka-on-aws">1.7.2. Using Eureka on AWS</a></h4>
|
||||
<div class="paragraph">
|
||||
<p>If the application is planned to be deployed to an AWS cloud, the Eureka instance must be configured to be AWS-aware. You can do so by customizing the <a href="https://github.com/spring-cloud/spring-cloud-netflix/tree/master/spring-cloud-netflix-eureka-client/src/main/java/org/springframework/cloud/netflix/eureka/EurekaInstanceConfigBean.java">EurekaInstanceConfigBean</a> as follows:</p>
|
||||
</div>
|
||||
<div class="listingblock">
|
||||
<div class="content">
|
||||
<pre class="highlightjs highlight"><code class="language-java hljs" data-lang="java">@Bean
|
||||
@Profile("!default")
|
||||
public EurekaInstanceConfigBean eurekaInstanceConfig(InetUtils inetUtils) {
|
||||
EurekaInstanceConfigBean b = new EurekaInstanceConfigBean(inetUtils);
|
||||
AmazonInfo info = AmazonInfo.Builder.newBuilder().autoBuild("eureka");
|
||||
b.setDataCenterInfo(info);
|
||||
return b;
|
||||
}</code></pre>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="sect3">
|
||||
<h4 id="changing-the-eureka-instance-id"><a class="anchor" href="#changing-the-eureka-instance-id"></a><a class="link" href="#changing-the-eureka-instance-id">1.7.3. Changing the Eureka Instance ID</a></h4>
|
||||
<div class="paragraph">
|
||||
<p>A vanilla Netflix Eureka instance is registered with an ID that is equal to its host name (that is, there is only one service per host).
|
||||
Spring Cloud Eureka provides a sensible default, which is defined as follows:</p>
|
||||
</div>
|
||||
<div class="paragraph">
|
||||
<p><code>${spring.cloud.client.hostname}:${spring.application.name}:${spring.application.instance_id:${server.port}}}</code></p>
|
||||
</div>
|
||||
<div class="paragraph">
|
||||
<p>An example is <code>myhost:myappname:8080</code>.</p>
|
||||
</div>
|
||||
<div class="paragraph">
|
||||
<p>By using Spring Cloud, you can override this value by providing a unique identifier in <code>eureka.instance.instanceId</code>, as shown in the following example:</p>
|
||||
</div>
|
||||
<div class="listingblock">
|
||||
<div class="title">application.yml</div>
|
||||
<div class="content">
|
||||
<pre>eureka:
|
||||
instance:
|
||||
instanceId: ${spring.application.name}:${vcap.application.instance_id:${spring.application.instance_id:${random.value}}}</pre>
|
||||
</div>
|
||||
</div>
|
||||
<div class="paragraph">
|
||||
<p>With the metadata shown in the preceding example and multiple service instances deployed on localhost, the random value is inserted there to make the instance unique.
|
||||
In Cloud Foundry, the <code>vcap.application.instance_id</code> is populated automatically in a Spring Boot application, so the random value is not needed.</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="sect2">
|
||||
<h3 id="using-the-eurekaclient"><a class="anchor" href="#using-the-eurekaclient"></a><a class="link" href="#using-the-eurekaclient">1.8. Using the EurekaClient</a></h3>
|
||||
<div class="paragraph">
|
||||
<p>Once you have an application that is a discovery client, you can use it to discover service instances from the <a href="#spring-cloud-eureka-server">Eureka Server</a>.
|
||||
One way to do so is to use the native <code>com.netflix.discovery.EurekaClient</code> (as opposed to the Spring Cloud <code>DiscoveryClient</code>), as shown in the following example:</p>
|
||||
</div>
|
||||
<div class="listingblock">
|
||||
<div class="content">
|
||||
<pre>@Autowired
|
||||
private EurekaClient discoveryClient;
|
||||
|
||||
public String serviceUrl() {
|
||||
InstanceInfo instance = discoveryClient.getNextServerFromEureka("STORES", false);
|
||||
return instance.getHomePageUrl();
|
||||
}</pre>
|
||||
</div>
|
||||
</div>
|
||||
<div class="admonitionblock tip">
|
||||
<table>
|
||||
<tr>
|
||||
<td class="icon">
|
||||
<i class="fa icon-tip" title="Tip"></i>
|
||||
</td>
|
||||
<td class="content">
|
||||
<div class="paragraph">
|
||||
<p>Do not use the <code>EurekaClient</code> in a <code>@PostConstruct</code> method or in a <code>@Scheduled</code> method (or anywhere where the <code>ApplicationContext</code> might not be started yet).
|
||||
It is initialized in a <code>SmartLifecycle</code> (with <code>phase=0</code>), so the earliest you can rely on it being available is in another <code>SmartLifecycle</code> with a higher phase.</p>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
<div class="sect3">
|
||||
<h4 id="eurekaclient-without-jersey"><a class="anchor" href="#eurekaclient-without-jersey"></a><a class="link" href="#eurekaclient-without-jersey">1.8.1. EurekaClient without Jersey</a></h4>
|
||||
<div class="paragraph">
|
||||
<p>By default, EurekaClient uses Jersey for HTTP communication.
|
||||
If you wish to avoid dependencies from Jersey, you can exclude it from your dependencies.
|
||||
Spring Cloud auto-configures a transport client based on Spring <code>RestTemplate</code>.
|
||||
The following example shows Jersey being excluded:</p>
|
||||
</div>
|
||||
<div class="listingblock">
|
||||
<div class="content">
|
||||
<pre><dependency>
|
||||
<groupId>org.springframework.cloud</groupId>
|
||||
<artifactId>spring-cloud-starter-netflix-eureka-client</artifactId>
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
<groupId>com.sun.jersey</groupId>
|
||||
<artifactId>jersey-client</artifactId>
|
||||
</exclusion>
|
||||
<exclusion>
|
||||
<groupId>com.sun.jersey</groupId>
|
||||
<artifactId>jersey-core</artifactId>
|
||||
</exclusion>
|
||||
<exclusion>
|
||||
<groupId>com.sun.jersey.contribs</groupId>
|
||||
<artifactId>jersey-apache-client4</artifactId>
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency></pre>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="sect2">
|
||||
<h3 id="alternatives-to-the-native-netflix-eurekaclient"><a class="anchor" href="#alternatives-to-the-native-netflix-eurekaclient"></a><a class="link" href="#alternatives-to-the-native-netflix-eurekaclient">1.9. Alternatives to the Native Netflix EurekaClient</a></h3>
|
||||
<div class="paragraph">
|
||||
<p>You need not use the raw Netflix <code>EurekaClient</code>.
|
||||
Also, it is usually more convenient to use it behind a wrapper of some sort.
|
||||
Spring Cloud has support for <a href="#spring-cloud-feign">Feign</a> (a REST client builder) and <a href="#spring-cloud-ribbon">Spring <code>RestTemplate</code></a> through the logical Eureka service identifiers (VIPs) instead of physical URLs.
|
||||
To configure Ribbon with a fixed list of physical servers, you can set <code><client>.ribbon.listOfServers</code> to a comma-separated list of physical addresses (or hostnames), where <code><client></code> is the ID of the client.</p>
|
||||
</div>
|
||||
<div class="paragraph">
|
||||
<p>You can also use the <code>org.springframework.cloud.client.discovery.DiscoveryClient</code>, which provides a simple API (not specific to Netflix) for discovery clients, as shown in the following example:</p>
|
||||
</div>
|
||||
<div class="listingblock">
|
||||
<div class="content">
|
||||
<pre>@Autowired
|
||||
private DiscoveryClient discoveryClient;
|
||||
|
||||
public String serviceUrl() {
|
||||
List<ServiceInstance> list = discoveryClient.getInstances("STORES");
|
||||
if (list != null && list.size() > 0 ) {
|
||||
return list.get(0).getUri();
|
||||
}
|
||||
return null;
|
||||
}</pre>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="sect2">
|
||||
<h3 id="why-is-it-so-slow-to-register-a-service"><a class="anchor" href="#why-is-it-so-slow-to-register-a-service"></a><a class="link" href="#why-is-it-so-slow-to-register-a-service">1.10. Why Is It so Slow to Register a Service?</a></h3>
|
||||
<div class="paragraph">
|
||||
<p>Being an instance also involves a periodic heartbeat to the registry
|
||||
(through the client’s <code>serviceUrl</code>) with a default duration of 30 seconds.
|
||||
A service is not available for discovery by clients until the instance, the server, and the client all have the same metadata in their local
|
||||
cache (so it could take 3 heartbeats).
|
||||
You can change the period by setting <code>eureka.instance.leaseRenewalIntervalInSeconds</code>.
|
||||
Setting it to a value of less than 30 speeds up the process of getting clients connected to other services.
|
||||
In production, it is probably better to stick with the default, because of internal computations in the server that make assumptions about the lease renewal period.</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="sect2">
|
||||
<h3 id="zones"><a class="anchor" href="#zones"></a><a class="link" href="#zones">1.11. Zones</a></h3>
|
||||
<div class="paragraph">
|
||||
<p>If you have deployed Eureka clients to multiple zones, you may prefer that those clients use services within the same zone before trying services in another zone.
|
||||
To set that up, you need to configure your Eureka clients correctly.</p>
|
||||
</div>
|
||||
<div class="paragraph">
|
||||
<p>First, you need to make sure you have Eureka servers deployed to each zone and that
|
||||
they are peers of each other.
|
||||
See the section on <a href="#spring-cloud-eureka-server-zones-and-regions">zones and regions</a>
|
||||
for more information.</p>
|
||||
</div>
|
||||
<div class="paragraph">
|
||||
<p>Next, you need to tell Eureka which zone your service is in.
|
||||
You can do so by using the <code>metadataMap</code> property.
|
||||
For example, if <code>service 1</code> is deployed to both <code>zone 1</code> and <code>zone 2</code>, you need to set the following Eureka properties in <code>service 1</code>:</p>
|
||||
</div>
|
||||
<div class="paragraph">
|
||||
<p><strong>Service 1 in Zone 1</strong></p>
|
||||
</div>
|
||||
<div class="listingblock">
|
||||
<div class="content">
|
||||
<pre class="highlightjs highlight"><code>eureka.instance.metadataMap.zone = zone1
|
||||
eureka.client.preferSameZoneEureka = true</code></pre>
|
||||
</div>
|
||||
</div>
|
||||
<div class="paragraph">
|
||||
<p><strong>Service 1 in Zone 2</strong></p>
|
||||
</div>
|
||||
<div class="listingblock">
|
||||
<div class="content">
|
||||
<pre class="highlightjs highlight"><code>eureka.instance.metadataMap.zone = zone2
|
||||
eureka.client.preferSameZoneEureka = true</code></pre>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="sect2">
|
||||
<h3 id="refreshing-eureka-clients"><a class="anchor" href="#refreshing-eureka-clients"></a><a class="link" href="#refreshing-eureka-clients">1.12. Refreshing Eureka Clients</a></h3>
|
||||
<div class="paragraph">
|
||||
<p>By default, the <code>EurekaClient</code> bean is refreshable, meaning the Eureka client properties can be changed and refreshed.
|
||||
When a refresh occurs clients will be unregistered from the Eureka server and there might be a brief moment of time
|
||||
where all instance of a given service are not available. One way to eliminate this from happening is to disable
|
||||
the ability to refresh Eureka clients. To do this set <code>eureka.client.refresh.enable=false</code>.</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="sect2">
|
||||
<h3 id="using-eureka-with-spring-cloud-loadbalancer"><a class="anchor" href="#using-eureka-with-spring-cloud-loadbalancer"></a><a class="link" href="#using-eureka-with-spring-cloud-loadbalancer">1.13. Using Eureka with Spring Cloud LoadBalancer</a></h3>
|
||||
<div class="paragraph">
|
||||
<p>We offer support for the Spring Cloud LoadBalancer <code>ZonePreferenceServiceInstanceListSupplier</code>.
|
||||
The <code>zone</code> value from the Eureka instance metadata (<code>eureka.instance.metadataMap.zone</code>) is used for setting the
|
||||
value of <code>spring-clod-loadbalancer-zone</code> property that is used to filter service instances by zone.</p>
|
||||
</div>
|
||||
<div class="paragraph">
|
||||
<p>If that is missing and if the <code>spring.cloud.loadbalancer.eureka.approximateZoneFromHostname</code> flag is set to <code>true</code>,
|
||||
it can use the domain name from the server hostname as a proxy for the zone.</p>
|
||||
</div>
|
||||
<div class="paragraph">
|
||||
<p>If there is no other source of zone data, then a guess is made, based on the client configuration (as opposed to the instance configuration).
|
||||
We take <code>eureka.client.availabilityZones</code>, which is a map from region name to a list of zones, and pull out the first zone for the instance’s own region (that is, the <code>eureka.client.region</code>, which defaults to "us-east-1", for compatibility with native Netflix).</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="sect1">
|
||||
<h2 id="spring-cloud-eureka-server"><a class="anchor" href="#spring-cloud-eureka-server"></a><a class="link" href="#spring-cloud-eureka-server">2. Service Discovery: Eureka Server</a></h2>
|
||||
<div class="sectionbody">
|
||||
<div class="paragraph">
|
||||
<p>This section describes how to set up a Eureka server.</p>
|
||||
</div>
|
||||
<div class="sect2">
|
||||
<h3 id="netflix-eureka-server-starter"><a class="anchor" href="#netflix-eureka-server-starter"></a><a class="link" href="#netflix-eureka-server-starter">2.1. How to Include Eureka Server</a></h3>
|
||||
<div class="paragraph">
|
||||
<p>To include Eureka Server in your project, use the starter with a group ID of <code>org.springframework.cloud</code> and an artifact ID of <code>spring-cloud-starter-netflix-eureka-server</code>.
|
||||
See the <a href="https://projects.spring.io/spring-cloud/">Spring Cloud Project page</a> for details on setting up your build system with the current Spring Cloud Release Train.</p>
|
||||
</div>
|
||||
<div class="admonitionblock note">
|
||||
<table>
|
||||
<tr>
|
||||
<td class="icon">
|
||||
<i class="fa icon-note" title="Note"></i>
|
||||
</td>
|
||||
<td class="content">
|
||||
If your project already uses Thymeleaf as its template engine, the Freemarker templates of the Eureka server may not be loaded correctly. In this case it is necessary to configure the template loader manually:
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
<div class="listingblock">
|
||||
<div class="title">application.yml</div>
|
||||
<div class="content">
|
||||
<pre>spring:
|
||||
freemarker:
|
||||
template-loader-path: classpath:/templates/
|
||||
prefer-file-system-access: false</pre>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="sect2">
|
||||
<h3 id="spring-cloud-running-eureka-server"><a class="anchor" href="#spring-cloud-running-eureka-server"></a><a class="link" href="#spring-cloud-running-eureka-server">2.2. How to Run a Eureka Server</a></h3>
|
||||
<div class="paragraph">
|
||||
<p>The following example shows a minimal Eureka server:</p>
|
||||
</div>
|
||||
<div class="listingblock">
|
||||
<div class="content">
|
||||
<pre class="highlightjs highlight"><code class="language-java hljs" data-lang="java">@SpringBootApplication
|
||||
@EnableEurekaServer
|
||||
public class Application {
|
||||
|
||||
public static void main(String[] args) {
|
||||
new SpringApplicationBuilder(Application.class).web(true).run(args);
|
||||
}
|
||||
|
||||
}</code></pre>
|
||||
</div>
|
||||
</div>
|
||||
<div class="paragraph">
|
||||
<p>The server has a home page with a UI and HTTP API endpoints for the normal Eureka functionality under <code>/eureka/*</code>.</p>
|
||||
</div>
|
||||
<div class="paragraph">
|
||||
<p>The following links have some Eureka background reading: <a href="https://github.com/cfregly/fluxcapacitor/wiki/NetflixOSS-FAQ#eureka-service-discovery-load-balancer">flux capacitor</a> and <a href="https://groups.google.com/forum/?fromgroups#!topic/eureka_netflix/g3p2r7gHnN0">google group discussion</a>.</p>
|
||||
</div>
|
||||
<div class="admonitionblock tip">
|
||||
<table>
|
||||
<tr>
|
||||
<td class="icon">
|
||||
<i class="fa icon-tip" title="Tip"></i>
|
||||
</td>
|
||||
<td class="content">
|
||||
<div class="paragraph">
|
||||
<p>Due to Gradle’s dependency resolution rules and the lack of a parent bom feature, depending on <code>spring-cloud-starter-netflix-eureka-server</code> can cause failures on application startup.
|
||||
To remedy this issue, add the Spring Boot Gradle plugin and import the Spring cloud starter parent bom as follows:</p>
|
||||
</div>
|
||||
<div class="listingblock">
|
||||
<div class="title">build.gradle</div>
|
||||
<div class="content">
|
||||
<pre class="highlightjs highlight"><code class="language-java hljs" data-lang="java">buildscript {
|
||||
dependencies {
|
||||
classpath("org.springframework.boot:spring-boot-gradle-plugin:{spring-boot-docs-version}")
|
||||
}
|
||||
}
|
||||
|
||||
apply plugin: "spring-boot"
|
||||
|
||||
dependencyManagement {
|
||||
imports {
|
||||
mavenBom "org.springframework.cloud:spring-cloud-dependencies:{spring-cloud-version}"
|
||||
}
|
||||
}</code></pre>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
<div class="sect2">
|
||||
<h3 id="spring-cloud-eureka-server-zones-and-regions"><a class="anchor" href="#spring-cloud-eureka-server-zones-and-regions"></a><a class="link" href="#spring-cloud-eureka-server-zones-and-regions">2.3. High Availability, Zones and Regions</a></h3>
|
||||
<div class="paragraph">
|
||||
<p>The Eureka server does not have a back end store, but the service instances in the registry all have to send heartbeats to keep their registrations up to date (so this can be done in memory).
|
||||
Clients also have an in-memory cache of Eureka registrations (so they do not have to go to the registry for every request to a service).</p>
|
||||
</div>
|
||||
<div class="paragraph">
|
||||
<p>By default, every Eureka server is also a Eureka client and requires (at least one) service URL to locate a peer.
|
||||
If you do not provide it, the service runs and works, but it fills your logs with a lot of noise about not being able to register with the peer.</p>
|
||||
</div>
|
||||
<div class="paragraph">
|
||||
<p>See also <a href="#spring-cloud-ribbon">below for details of Ribbon support</a> on the client side for Zones and Regions.</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="sect2">
|
||||
<h3 id="spring-cloud-eureka-server-standalone-mode"><a class="anchor" href="#spring-cloud-eureka-server-standalone-mode"></a><a class="link" href="#spring-cloud-eureka-server-standalone-mode">2.4. Standalone Mode</a></h3>
|
||||
<div class="paragraph">
|
||||
<p>The combination of the two caches (client and server) and the heartbeats make a standalone Eureka server fairly resilient to failure, as long as there is some sort of monitor or elastic runtime (such as Cloud Foundry) keeping it alive.
|
||||
In standalone mode, you might prefer to switch off the client side behavior so that it does not keep trying and failing to reach its peers.
|
||||
The following example shows how to switch off the client-side behavior:</p>
|
||||
</div>
|
||||
<div class="listingblock">
|
||||
<div class="title">application.yml (Standalone Eureka Server)</div>
|
||||
<div class="content">
|
||||
<pre>server:
|
||||
port: 8761
|
||||
|
||||
eureka:
|
||||
instance:
|
||||
hostname: localhost
|
||||
client:
|
||||
registerWithEureka: false
|
||||
fetchRegistry: false
|
||||
serviceUrl:
|
||||
defaultZone: http://${eureka.instance.hostname}:${server.port}/eureka/</pre>
|
||||
</div>
|
||||
</div>
|
||||
<div class="paragraph">
|
||||
<p>Notice that the <code>serviceUrl</code> is pointing to the same host as the local instance.</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="sect2">
|
||||
<h3 id="spring-cloud-eureka-server-peer-awareness"><a class="anchor" href="#spring-cloud-eureka-server-peer-awareness"></a><a class="link" href="#spring-cloud-eureka-server-peer-awareness">2.5. Peer Awareness</a></h3>
|
||||
<div class="paragraph">
|
||||
<p>Eureka can be made even more resilient and available by running multiple instances and asking them to register with each other.
|
||||
In fact, this is the default behavior, so all you need to do to make it work is add a valid <code>serviceUrl</code> to a peer, as shown in the following example:</p>
|
||||
</div>
|
||||
<div class="listingblock">
|
||||
<div class="title">application.yml (Two Peer Aware Eureka Servers)</div>
|
||||
<div class="content">
|
||||
<pre>---
|
||||
spring:
|
||||
profiles: peer1
|
||||
eureka:
|
||||
instance:
|
||||
hostname: peer1
|
||||
client:
|
||||
serviceUrl:
|
||||
defaultZone: https://peer2/eureka/
|
||||
|
||||
---
|
||||
spring:
|
||||
profiles: peer2
|
||||
eureka:
|
||||
instance:
|
||||
hostname: peer2
|
||||
client:
|
||||
serviceUrl:
|
||||
defaultZone: https://peer1/eureka/</pre>
|
||||
</div>
|
||||
</div>
|
||||
<div class="paragraph">
|
||||
<p>In the preceding example, we have a YAML file that can be used to run the same server on two hosts (<code>peer1</code> and <code>peer2</code>) by running it in different Spring profiles.
|
||||
You could use this configuration to test the peer awareness on a single host (there is not much value in doing that in production) by manipulating <code>/etc/hosts</code> to resolve the host names.
|
||||
In fact, the <code>eureka.instance.hostname</code> is not needed if you are running on a machine that knows its own hostname (by default, it is looked up by using <code>java.net.InetAddress</code>).</p>
|
||||
</div>
|
||||
<div class="paragraph">
|
||||
<p>You can add multiple peers to a system, and, as long as they are all connected to each other by at least one edge, they synchronize
|
||||
the registrations amongst themselves.
|
||||
If the peers are physically separated (inside a data center or between multiple data centers), then the system can, in principle, survive “split-brain” type failures.
|
||||
You can add multiple peers to a system, and as long as they are all
|
||||
directly connected to each other, they will synchronize
|
||||
the registrations amongst themselves.</p>
|
||||
</div>
|
||||
<div class="listingblock">
|
||||
<div class="title">application.yml (Three Peer Aware Eureka Servers)</div>
|
||||
<div class="content">
|
||||
<pre>eureka:
|
||||
client:
|
||||
serviceUrl:
|
||||
defaultZone: https://peer1/eureka/,http://peer2/eureka/,http://peer3/eureka/
|
||||
|
||||
---
|
||||
spring:
|
||||
profiles: peer1
|
||||
eureka:
|
||||
instance:
|
||||
hostname: peer1
|
||||
|
||||
---
|
||||
spring:
|
||||
profiles: peer2
|
||||
eureka:
|
||||
instance:
|
||||
hostname: peer2
|
||||
|
||||
---
|
||||
spring:
|
||||
profiles: peer3
|
||||
eureka:
|
||||
instance:
|
||||
hostname: peer3</pre>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="sect2">
|
||||
<h3 id="spring-cloud-eureka-server-prefer-ip-address"><a class="anchor" href="#spring-cloud-eureka-server-prefer-ip-address"></a><a class="link" href="#spring-cloud-eureka-server-prefer-ip-address">2.6. When to Prefer IP Address</a></h3>
|
||||
<div class="paragraph">
|
||||
<p>In some cases, it is preferable for Eureka to advertise the IP addresses of services rather than the hostname.
|
||||
Set <code>eureka.instance.preferIpAddress</code> to <code>true</code> and, when the application registers with eureka, it uses its IP address rather than its hostname.</p>
|
||||
</div>
|
||||
<div class="admonitionblock tip">
|
||||
<table>
|
||||
<tr>
|
||||
<td class="icon">
|
||||
<i class="fa icon-tip" title="Tip"></i>
|
||||
</td>
|
||||
<td class="content">
|
||||
<div class="paragraph">
|
||||
<p>If the hostname cannot be determined by Java, then the IP address is sent to Eureka.
|
||||
Only explict way of setting the hostname is by setting <code>eureka.instance.hostname</code> property.
|
||||
You can set your hostname at the run-time by using an environment variable — for example, <code>eureka.instance.hostname=${HOST_NAME}</code>.</p>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
<div class="sect2">
|
||||
<h3 id="securing-the-eureka-server"><a class="anchor" href="#securing-the-eureka-server"></a><a class="link" href="#securing-the-eureka-server">2.7. Securing The Eureka Server</a></h3>
|
||||
<div class="paragraph">
|
||||
<p>You can secure your Eureka server simply by adding Spring Security to your
|
||||
server’s classpath via <code>spring-boot-starter-security</code>. By default when Spring Security is on the classpath it will require that
|
||||
a valid CSRF token be sent with every request to the app. Eureka clients will not generally possess a valid
|
||||
cross site request forgery (CSRF) token you will need to disable this requirement for the <code>/eureka/**</code> endpoints.
|
||||
For example:</p>
|
||||
</div>
|
||||
<div class="listingblock">
|
||||
<div class="content">
|
||||
<pre class="highlightjs highlight"><code class="language-java hljs" data-lang="java">@EnableWebSecurity
|
||||
class WebSecurityConfig extends WebSecurityConfigurerAdapter {
|
||||
|
||||
@Override
|
||||
protected void configure(HttpSecurity http) throws Exception {
|
||||
http.csrf().ignoringAntMatchers("/eureka/**");
|
||||
super.configure(http);
|
||||
}
|
||||
}</code></pre>
|
||||
</div>
|
||||
</div>
|
||||
<div class="paragraph">
|
||||
<p>For more information on CSRF see the <a href="https://docs.spring.io/spring-security/site/docs/current/reference/htmlsingle/#csrf">Spring Security documentation</a>.</p>
|
||||
</div>
|
||||
<div class="paragraph">
|
||||
<p>A demo Eureka Server can be found in the Spring Cloud Samples <a href="https://github.com/spring-cloud-samples/eureka/tree/Eureka-With-Security">repo</a>.</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="sect2">
|
||||
<h3 id="jdk-11-support"><a class="anchor" href="#jdk-11-support"></a><a class="link" href="#jdk-11-support">2.8. JDK 11 Support</a></h3>
|
||||
<div class="paragraph">
|
||||
<p>The JAXB modules which the Eureka server depends upon were removed in JDK 11. If you intend to use JDK 11
|
||||
when running a Eureka server you must include these dependencies in your POM or Gradle file.</p>
|
||||
</div>
|
||||
<div class="listingblock">
|
||||
<div class="content">
|
||||
<pre class="highlightjs highlight"><code class="language-xml hljs" data-lang="xml"><dependency>
|
||||
<groupId>org.glassfish.jaxb</groupId>
|
||||
<artifactId>jaxb-runtime</artifactId>
|
||||
</dependency></code></pre>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="sect1">
|
||||
<h2 id="configuration-properties"><a class="anchor" href="#configuration-properties"></a><a class="link" href="#configuration-properties">3. Configuration properties</a></h2>
|
||||
<div class="sectionbody">
|
||||
<div class="paragraph">
|
||||
<p>To see the list of all Spring Cloud Netflix related configuration properties please check <a href="appendix.html">the Appendix page</a>.</p>
|
||||
</div>
|
||||
</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/github.min.css">
|
||||
<script src="js/highlight/highlight.min.js"></script>
|
||||
<script>hljs.initHighlighting()</script>
|
||||
</body>
|
||||
</html>
|
||||
135
spring-cloud-netflix/3.0.0-M2/reference/html/intro.html
Normal file
@@ -0,0 +1,135 @@
|
||||
<!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.8">
|
||||
<title>Untitled</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};
|
||||
}
|
||||
|
||||
function globalSwitch() {
|
||||
$('.switch--item').each(function() {
|
||||
$(this).off('click');
|
||||
$(this).on('click', function() {
|
||||
selectedText = $(this).text()
|
||||
selectedIndex = $(this).index()
|
||||
$(".switch--item").filter(function() { return ($(this).text() === selectedText) }).each(function() {
|
||||
$(this).addClass('selected');
|
||||
$(this).siblings().removeClass('selected');
|
||||
selectedContent = $(this).parent().siblings(".content").eq(selectedIndex)
|
||||
selectedContent.removeClass('hidden');
|
||||
selectedContent.siblings().addClass('hidden');
|
||||
});
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
$(addBlockSwitches);
|
||||
$(globalSwitch);
|
||||
|
||||
</script>
|
||||
|
||||
</head>
|
||||
<body class="book">
|
||||
<div id="header">
|
||||
</div>
|
||||
<div id="content">
|
||||
<div id="preamble">
|
||||
<div class="sectionbody">
|
||||
<div class="paragraph">
|
||||
<p>This project provides Netflix OSS 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 battle-tested Netflix components. The
|
||||
patterns provided include Service Discovery (Eureka), Circuit Breaker (Hystrix),
|
||||
Intelligent Routing (Zuul) and Client Side Load Balancing (Ribbon).</p>
|
||||
</div>
|
||||
</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/github.min.css">
|
||||
<script src="js/highlight/highlight.min.js"></script>
|
||||
<script>hljs.initHighlighting()</script>
|
||||
</body>
|
||||
</html>
|
||||
2
spring-cloud-netflix/3.0.0-M2/reference/html/js/highlight/highlight.min.js
vendored
Normal file
96
spring-cloud-netflix/3.0.0-M2/reference/html/js/highlight/styles/atom-one-light.min.css
vendored
Normal file
@@ -0,0 +1,96 @@
|
||||
/*
|
||||
|
||||
Atom One Light by Daniel Gamage
|
||||
Original One Light Syntax theme from https://github.com/atom/one-light-syntax
|
||||
|
||||
base: #fafafa
|
||||
mono-1: #383a42
|
||||
mono-2: #686b77
|
||||
mono-3: #a0a1a7
|
||||
hue-1: #0184bb
|
||||
hue-2: #4078f2
|
||||
hue-3: #a626a4
|
||||
hue-4: #50a14f
|
||||
hue-5: #e45649
|
||||
hue-5-2: #c91243
|
||||
hue-6: #986801
|
||||
hue-6-2: #c18401
|
||||
|
||||
*/
|
||||
|
||||
.hljs {
|
||||
display: block;
|
||||
overflow-x: auto;
|
||||
padding: 0.5em;
|
||||
color: #383a42;
|
||||
background: #fafafa;
|
||||
}
|
||||
|
||||
.hljs-comment,
|
||||
.hljs-quote {
|
||||
color: #a0a1a7;
|
||||
font-style: italic;
|
||||
}
|
||||
|
||||
.hljs-doctag,
|
||||
.hljs-keyword,
|
||||
.hljs-formula {
|
||||
color: #a626a4;
|
||||
}
|
||||
|
||||
.hljs-section,
|
||||
.hljs-name,
|
||||
.hljs-selector-tag,
|
||||
.hljs-deletion,
|
||||
.hljs-subst {
|
||||
color: #e45649;
|
||||
}
|
||||
|
||||
.hljs-literal {
|
||||
color: #0184bb;
|
||||
}
|
||||
|
||||
.hljs-string,
|
||||
.hljs-regexp,
|
||||
.hljs-addition,
|
||||
.hljs-attribute,
|
||||
.hljs-meta-string {
|
||||
color: #50a14f;
|
||||
}
|
||||
|
||||
.hljs-built_in,
|
||||
.hljs-class .hljs-title {
|
||||
color: #c18401;
|
||||
}
|
||||
|
||||
.hljs-attr,
|
||||
.hljs-variable,
|
||||
.hljs-template-variable,
|
||||
.hljs-type,
|
||||
.hljs-selector-class,
|
||||
.hljs-selector-attr,
|
||||
.hljs-selector-pseudo,
|
||||
.hljs-number {
|
||||
color: #986801;
|
||||
}
|
||||
|
||||
.hljs-symbol,
|
||||
.hljs-bullet,
|
||||
.hljs-link,
|
||||
.hljs-meta,
|
||||
.hljs-selector-id,
|
||||
.hljs-title {
|
||||
color: #4078f2;
|
||||
}
|
||||
|
||||
.hljs-emphasis {
|
||||
font-style: italic;
|
||||
}
|
||||
|
||||
.hljs-strong {
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.hljs-link {
|
||||
text-decoration: underline;
|
||||
}
|
||||
@@ -0,0 +1,79 @@
|
||||
/**
|
||||
* GitHub Gist Theme
|
||||
* Author : Anthony Attard - https://github.com/AnthonyAttard
|
||||
* Author : Louis Barranqueiro - https://github.com/LouisBarranqueiro
|
||||
*/
|
||||
|
||||
.hljs {
|
||||
display: block;
|
||||
background: white;
|
||||
padding: 0.5em;
|
||||
color: #333333;
|
||||
overflow-x: auto;
|
||||
}
|
||||
|
||||
.hljs-comment,
|
||||
.hljs-meta {
|
||||
color: #969896;
|
||||
}
|
||||
|
||||
.hljs-variable,
|
||||
.hljs-template-variable,
|
||||
.hljs-strong,
|
||||
.hljs-emphasis,
|
||||
.hljs-quote {
|
||||
color: #df5000;
|
||||
}
|
||||
|
||||
.hljs-keyword,
|
||||
.hljs-selector-tag,
|
||||
.hljs-type {
|
||||
color: #d73a49;
|
||||
}
|
||||
|
||||
.hljs-literal,
|
||||
.hljs-symbol,
|
||||
.hljs-bullet,
|
||||
.hljs-attribute {
|
||||
color: #0086b3;
|
||||
}
|
||||
|
||||
.hljs-section,
|
||||
.hljs-name {
|
||||
color: #63a35c;
|
||||
}
|
||||
|
||||
.hljs-tag {
|
||||
color: #333333;
|
||||
}
|
||||
|
||||
.hljs-title,
|
||||
.hljs-attr,
|
||||
.hljs-selector-id,
|
||||
.hljs-selector-class,
|
||||
.hljs-selector-attr,
|
||||
.hljs-selector-pseudo {
|
||||
color: #6f42c1;
|
||||
}
|
||||
|
||||
.hljs-addition {
|
||||
color: #55a532;
|
||||
background-color: #eaffea;
|
||||
}
|
||||
|
||||
.hljs-deletion {
|
||||
color: #bd2c00;
|
||||
background-color: #ffecec;
|
||||
}
|
||||
|
||||
.hljs-link {
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
.hljs-number {
|
||||
color: #005cc5;
|
||||
}
|
||||
|
||||
.hljs-string {
|
||||
color: #032f62;
|
||||
}
|
||||
99
spring-cloud-netflix/3.0.0-M2/reference/html/js/highlight/styles/github.min.css
vendored
Normal file
@@ -0,0 +1,99 @@
|
||||
/*
|
||||
|
||||
github.com style (c) Vasily Polovnyov <vast@whiteants.net>
|
||||
|
||||
*/
|
||||
|
||||
.hljs {
|
||||
display: block;
|
||||
overflow-x: auto;
|
||||
padding: 0.5em;
|
||||
color: #333;
|
||||
background: #f8f8f8;
|
||||
}
|
||||
|
||||
.hljs-comment,
|
||||
.hljs-quote {
|
||||
color: #998;
|
||||
font-style: italic;
|
||||
}
|
||||
|
||||
.hljs-keyword,
|
||||
.hljs-selector-tag,
|
||||
.hljs-subst {
|
||||
color: #333;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.hljs-number,
|
||||
.hljs-literal,
|
||||
.hljs-variable,
|
||||
.hljs-template-variable,
|
||||
.hljs-tag .hljs-attr {
|
||||
color: #008080;
|
||||
}
|
||||
|
||||
.hljs-string,
|
||||
.hljs-doctag {
|
||||
color: #d14;
|
||||
}
|
||||
|
||||
.hljs-title,
|
||||
.hljs-section,
|
||||
.hljs-selector-id {
|
||||
color: #900;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.hljs-subst {
|
||||
font-weight: normal;
|
||||
}
|
||||
|
||||
.hljs-type,
|
||||
.hljs-class .hljs-title {
|
||||
color: #458;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.hljs-tag,
|
||||
.hljs-name,
|
||||
.hljs-attribute {
|
||||
color: #000080;
|
||||
font-weight: normal;
|
||||
}
|
||||
|
||||
.hljs-regexp,
|
||||
.hljs-link {
|
||||
color: #009926;
|
||||
}
|
||||
|
||||
.hljs-symbol,
|
||||
.hljs-bullet {
|
||||
color: #990073;
|
||||
}
|
||||
|
||||
.hljs-built_in,
|
||||
.hljs-builtin-name {
|
||||
color: #0086b3;
|
||||
}
|
||||
|
||||
.hljs-meta {
|
||||
color: #999;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.hljs-deletion {
|
||||
background: #fdd;
|
||||
}
|
||||
|
||||
.hljs-addition {
|
||||
background: #dfd;
|
||||
}
|
||||
|
||||
.hljs-emphasis {
|
||||
font-style: italic;
|
||||
}
|
||||
|
||||
.hljs-strong {
|
||||
font-weight: bold;
|
||||
}
|
||||
@@ -0,0 +1,89 @@
|
||||
/*
|
||||
|
||||
Google Code style (c) Aahan Krish <geekpanth3r@gmail.com>
|
||||
|
||||
*/
|
||||
|
||||
.hljs {
|
||||
display: block;
|
||||
overflow-x: auto;
|
||||
padding: 0.5em;
|
||||
background: white;
|
||||
color: black;
|
||||
}
|
||||
|
||||
.hljs-comment,
|
||||
.hljs-quote {
|
||||
color: #800;
|
||||
}
|
||||
|
||||
.hljs-keyword,
|
||||
.hljs-selector-tag,
|
||||
.hljs-section,
|
||||
.hljs-title,
|
||||
.hljs-name {
|
||||
color: #008;
|
||||
}
|
||||
|
||||
.hljs-variable,
|
||||
.hljs-template-variable {
|
||||
color: #660;
|
||||
}
|
||||
|
||||
.hljs-string,
|
||||
.hljs-selector-attr,
|
||||
.hljs-selector-pseudo,
|
||||
.hljs-regexp {
|
||||
color: #080;
|
||||
}
|
||||
|
||||
.hljs-literal,
|
||||
.hljs-symbol,
|
||||
.hljs-bullet,
|
||||
.hljs-meta,
|
||||
.hljs-number,
|
||||
.hljs-link {
|
||||
color: #066;
|
||||
}
|
||||
|
||||
.hljs-title,
|
||||
.hljs-doctag,
|
||||
.hljs-type,
|
||||
.hljs-attr,
|
||||
.hljs-built_in,
|
||||
.hljs-builtin-name,
|
||||
.hljs-params {
|
||||
color: #606;
|
||||
}
|
||||
|
||||
.hljs-attribute,
|
||||
.hljs-subst {
|
||||
color: #000;
|
||||
}
|
||||
|
||||
.hljs-formula {
|
||||
background-color: #eee;
|
||||
font-style: italic;
|
||||
}
|
||||
|
||||
.hljs-selector-id,
|
||||
.hljs-selector-class {
|
||||
color: #9B703F
|
||||
}
|
||||
|
||||
.hljs-addition {
|
||||
background-color: #baeeba;
|
||||
}
|
||||
|
||||
.hljs-deletion {
|
||||
background-color: #ffc8bd;
|
||||
}
|
||||
|
||||
.hljs-doctag,
|
||||
.hljs-strong {
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.hljs-emphasis {
|
||||
font-style: italic;
|
||||
}
|
||||
84
spring-cloud-netflix/3.0.0-M2/reference/html/js/highlight/styles/solarized-light.min.css
vendored
Normal file
@@ -0,0 +1,84 @@
|
||||
/*
|
||||
|
||||
Orginal Style from ethanschoonover.com/solarized (c) Jeremy Hull <sourdrums@gmail.com>
|
||||
|
||||
*/
|
||||
|
||||
.hljs {
|
||||
display: block;
|
||||
overflow-x: auto;
|
||||
padding: 0.5em;
|
||||
background: #fdf6e3;
|
||||
color: #657b83;
|
||||
}
|
||||
|
||||
.hljs-comment,
|
||||
.hljs-quote {
|
||||
color: #93a1a1;
|
||||
}
|
||||
|
||||
/* Solarized Green */
|
||||
.hljs-keyword,
|
||||
.hljs-selector-tag,
|
||||
.hljs-addition {
|
||||
color: #859900;
|
||||
}
|
||||
|
||||
/* Solarized Cyan */
|
||||
.hljs-number,
|
||||
.hljs-string,
|
||||
.hljs-meta .hljs-meta-string,
|
||||
.hljs-literal,
|
||||
.hljs-doctag,
|
||||
.hljs-regexp {
|
||||
color: #2aa198;
|
||||
}
|
||||
|
||||
/* Solarized Blue */
|
||||
.hljs-title,
|
||||
.hljs-section,
|
||||
.hljs-name,
|
||||
.hljs-selector-id,
|
||||
.hljs-selector-class {
|
||||
color: #268bd2;
|
||||
}
|
||||
|
||||
/* Solarized Yellow */
|
||||
.hljs-attribute,
|
||||
.hljs-attr,
|
||||
.hljs-variable,
|
||||
.hljs-template-variable,
|
||||
.hljs-class .hljs-title,
|
||||
.hljs-type {
|
||||
color: #b58900;
|
||||
}
|
||||
|
||||
/* Solarized Orange */
|
||||
.hljs-symbol,
|
||||
.hljs-bullet,
|
||||
.hljs-subst,
|
||||
.hljs-meta,
|
||||
.hljs-meta .hljs-keyword,
|
||||
.hljs-selector-attr,
|
||||
.hljs-selector-pseudo,
|
||||
.hljs-link {
|
||||
color: #cb4b16;
|
||||
}
|
||||
|
||||
/* Solarized Red */
|
||||
.hljs-built_in,
|
||||
.hljs-deletion {
|
||||
color: #dc322f;
|
||||
}
|
||||
|
||||
.hljs-formula {
|
||||
background: #eee8d5;
|
||||
}
|
||||
|
||||
.hljs-emphasis {
|
||||
font-style: italic;
|
||||
}
|
||||
|
||||
.hljs-strong {
|
||||
font-weight: bold;
|
||||
}
|
||||
80
spring-cloud-netflix/3.0.0-M2/reference/html/js/toc.js
Normal file
@@ -0,0 +1,80 @@
|
||||
var toctitle = document.getElementById('toctitle');
|
||||
var path = window.location.pathname;
|
||||
if (toctitle != null) {
|
||||
var oldtoc = toctitle.nextElementSibling;
|
||||
var newtoc = document.createElement('div');
|
||||
newtoc.setAttribute('id', 'tocbot');
|
||||
newtoc.setAttribute('class', 'js-toc desktop-toc');
|
||||
oldtoc.setAttribute('class', 'mobile-toc');
|
||||
oldtoc.parentNode.appendChild(newtoc);
|
||||
tocbot.init({
|
||||
contentSelector: '#content',
|
||||
headingSelector: 'h1, h2, h3, h4, h5',
|
||||
positionFixedSelector: 'body',
|
||||
fixedSidebarOffset: 90,
|
||||
smoothScroll: false
|
||||
});
|
||||
if (!path.endsWith("index.html") && !path.endsWith("/")) {
|
||||
var link = document.createElement("a");
|
||||
if (document.getElementById('index-link')) {
|
||||
indexLinkElement = document.querySelector('#index-link > p > a');
|
||||
linkHref = indexLinkElement.getAttribute("href");
|
||||
link.setAttribute("href", linkHref);
|
||||
} else {
|
||||
link.setAttribute("href", "index.html");
|
||||
}
|
||||
link.innerHTML = "<span><i class=\"fa fa-chevron-left\" aria-hidden=\"true\"></i></span> Back to index";
|
||||
var block = document.createElement("div");
|
||||
block.setAttribute('class', 'back-action');
|
||||
block.appendChild(link);
|
||||
var toc = document.getElementById('toc');
|
||||
var next = document.getElementById('toctitle').nextElementSibling;
|
||||
toc.insertBefore(block, next);
|
||||
}
|
||||
}
|
||||
|
||||
var headerHtml = '<div id="header-spring">\n' +
|
||||
'<h1>\n' +
|
||||
'<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0" y="0"\n' +
|
||||
'viewBox="0 0 245.8 45.3" style="enable-background:new 0 0 245.8 45.3;" xml:space="preserve">\n' +
|
||||
'<g id="logos">\n' +
|
||||
'<g>\n' +
|
||||
'<path class="st0" d="M39.4,3.7c-0.6,1.5-1.4,2.8-2.3,4c-3.9-4-9.3-6.4-15.2-6.4c-11.7,0-21.3,9.5-21.3,21.3\n' +
|
||||
'c0,6.2,2.6,11.7,6.8,15.6l0.8,0.7c3.7,3.1,8.5,5,13.7,5c11.2,0,20.4-8.7,21.2-19.8C43.7,18.7,42.1,11.8,39.4,3.7z M10.5,38.3\n' +
|
||||
'c-0.6,0.8-1.8,0.9-2.6,0.3C7.1,37.9,7,36.8,7.6,36c0.6-0.8,1.8-0.9,2.6-0.3C11,36.4,11.1,37.5,10.5,38.3z M39.3,31.9\n' +
|
||||
'c-5.2,7-16.5,4.6-23.6,5c0,0-1.3,0.1-2.6,0.3c0,0,0.5-0.2,1.1-0.4c5-1.7,7.4-2.1,10.5-3.7c5.8-3,11.5-9.4,12.7-16.1\n' +
|
||||
'c-2.2,6.4-8.9,12-14.9,14.2c-4.2,1.5-11.7,3-11.7,3c0,0-0.3-0.2-0.3-0.2c-5.1-2.5-5.3-13.6,4-17.1c4.1-1.6,8-0.7,12.4-1.8\n' +
|
||||
'C31.6,14.1,37,10.6,39.2,6C41.7,13.3,44.7,24.8,39.3,31.9z"/>\n' +
|
||||
'<g>\n' +
|
||||
'<path class="st0" d="M55.2,30.9c-0.5-0.3-0.9-0.9-0.9-1.6c0-1.1,0.8-1.9,1.9-1.9c0.4,0,0.7,0.1,1,0.3c2,1.3,4.1,2,5.9,2\n' +
|
||||
'c2,0,3.2-0.9,3.2-2.2v-0.1c0-1.6-2.2-2.2-4.6-2.9c-3-0.9-6.5-2.1-6.5-6.1v-0.1c0-3.9,3.2-6.3,7.4-6.3c2.2,0,4.5,0.6,6.5,1.7\n' +
|
||||
'c0.7,0.4,1.1,1,1.1,1.8c0,1.1-0.9,1.9-2,1.9c-0.4,0-0.6-0.1-0.9-0.2c-1.7-0.9-3.4-1.4-4.9-1.4c-1.8,0-2.9,0.9-2.9,2v0.1\n' +
|
||||
'c0,1.5,2.2,2.2,4.7,2.9c3,0.9,6.4,2.3,6.4,6v0.1c0,4.3-3.4,6.5-7.7,6.5C60.4,33.3,57.6,32.5,55.2,30.9z"/>\n' +
|
||||
'<path class="st0" d="M72.5,14.3c0-1.3,1-2.4,2.3-2.4c1.3,0,2.4,1.1,2.4,2.4v1.4c1.5-2.2,3.7-3.9,7-3.9c4.8,0,9.6,3.8,9.6,10.7\n' +
|
||||
'v0.1c0,6.8-4.7,10.7-9.6,10.7c-3.4,0-5.6-1.7-7-3.6V37c0,1.3-1.1,2.4-2.4,2.4c-1.3,0-2.3-1-2.3-2.4V14.3z M89.1,22.7L89.1,22.7\n' +
|
||||
'c0-4.1-2.7-6.7-5.9-6.7c-3.2,0-6,2.7-6,6.6v0.1c0,4,2.8,6.6,6,6.6C86.4,29.3,89.1,26.7,89.1,22.7z"/>\n' +
|
||||
'<path class="st0" d="M95.7,14.3c0-1.3,1-2.4,2.3-2.4c1.3,0,2.4,1.1,2.4,2.4v1.1c0.2-1.8,3.1-3.5,5.2-3.5c1.5,0,2.3,1,2.3,2.3\n' +
|
||||
'c0,1.3-0.8,2.1-1.9,2.3c-3.4,0.6-5.7,3.5-5.7,7.6V31c0,1.3-1.1,2.3-2.4,2.3c-1.3,0-2.3-1-2.3-2.3V14.3z"/>\n' +
|
||||
'<path class="st0" d="M109.7,14.3c0-1.3,1-2.4,2.3-2.4c1.3,0,2.4,1.1,2.4,2.4V31c0,1.3-1.1,2.3-2.4,2.3c-1.3,0-2.3-1-2.3-2.3V14.3\n' +
|
||||
'z"/>\n' +
|
||||
'<path class="st0" d="M116.9,14.3c0-1.3,1-2.4,2.3-2.4c1.3,0,2.4,1.1,2.4,2.4v1c1.3-1.9,3.2-3.4,6.5-3.4c4.7,0,7.4,3.1,7.4,7.9V31\n' +
|
||||
'c0,1.3-1,2.3-2.3,2.3c-1.3,0-2.4-1-2.4-2.3v-9.7c0-3.2-1.6-5-4.4-5c-2.7,0-4.7,1.9-4.7,5.1V31c0,1.3-1.1,2.3-2.4,2.3\n' +
|
||||
'c-1.3,0-2.3-1-2.3-2.3V14.3z"/>\n' +
|
||||
'<path class="st0" d="M156.2,11.9c-1.3,0-2.4,1.1-2.4,2.4v1.4c-1.5-2.2-3.7-3.9-7-3.9c-4.9,0-9.6,3.8-9.6,10.7v0.1\n' +
|
||||
'c0,6.8,4.7,10.7,9.6,10.7c3.4,0,5.6-1.7,7-3.6c-0.2,3.7-2.5,5.7-6.5,5.7c-2.4,0-4.5-0.6-6.3-1.6c-0.2-0.1-0.5-0.2-0.9-0.2\n' +
|
||||
'c-1.1,0-2,0.9-2,2c0,0.9,0.5,1.6,1.3,1.9c2.5,1.2,5.1,1.8,8,1.8c3.7,0,6.6-0.9,8.5-2.8c1.7-1.7,2.7-4.3,2.7-7.8V14.3\n' +
|
||||
'C158.5,13,157.5,11.9,156.2,11.9z M147.9,29.2c-3.2,0-5.9-2.5-5.9-6.6v-0.1c0-4,2.7-6.6,5.9-6.6c3.2,0,6,2.7,6,6.6v0.1\n' +
|
||||
'C153.9,26.6,151.1,29.2,147.9,29.2z"/>\n' +
|
||||
'<path class="st0" d="M114.5,6.3c0,1.3-1.1,2.4-2.4,2.4c-1.3,0-2.4-1.1-2.4-2.4c0-1.3,1.1-2.4,2.4-2.4\n' +
|
||||
'C113.4,3.9,114.5,4.9,114.5,6.3z"/>\n' +
|
||||
'</g>\n' +
|
||||
'</g>\n' +
|
||||
'</g>\n' +
|
||||
'</svg>\n' +
|
||||
'\n' +
|
||||
'</h1>\n' +
|
||||
'</div>';
|
||||
|
||||
var header = document.createElement("div");
|
||||
header.innerHTML = headerHtml;
|
||||
document.body.insertBefore(header, document.body.firstChild);
|
||||
@@ -0,0 +1 @@
|
||||
.toc{overflow-y:auto}.toc>.toc-list{overflow:hidden;position:relative}.toc>.toc-list li{list-style:none}.toc-list{margin:0;padding-left:10px}a.toc-link{color:currentColor;height:100%}.is-collapsible{max-height:1000px;overflow:hidden;transition:all 300ms ease-in-out}.is-collapsed{max-height:0}.is-position-fixed{position:fixed !important;top:0}.is-active-link{font-weight:700}.toc-link::before{background-color:#EEE;content:' ';display:inline-block;height:inherit;left:0;margin-top:-1px;position:absolute;width:2px}.is-active-link::before{background-color:#54BC4B}
|
||||
1
spring-cloud-netflix/3.0.0-M2/reference/html/js/tocbot/tocbot.min.js
vendored
Normal file
@@ -0,0 +1,191 @@
|
||||
<!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.8">
|
||||
<title>Modules In Maintenance Mode</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};
|
||||
}
|
||||
|
||||
function globalSwitch() {
|
||||
$('.switch--item').each(function() {
|
||||
$(this).off('click');
|
||||
$(this).on('click', function() {
|
||||
selectedText = $(this).text()
|
||||
selectedIndex = $(this).index()
|
||||
$(".switch--item").filter(function() { return ($(this).text() === selectedText) }).each(function() {
|
||||
$(this).addClass('selected');
|
||||
$(this).siblings().removeClass('selected');
|
||||
selectedContent = $(this).parent().siblings(".content").eq(selectedIndex)
|
||||
selectedContent.removeClass('hidden');
|
||||
selectedContent.siblings().addClass('hidden');
|
||||
});
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
$(addBlockSwitches);
|
||||
$(globalSwitch);
|
||||
|
||||
</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="#modules-in-maintenance-mode">1. Modules In Maintenance Mode</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div id="content">
|
||||
<div class="sect1">
|
||||
<h2 id="modules-in-maintenance-mode"><a class="anchor" href="#modules-in-maintenance-mode"></a><a class="link" href="#modules-in-maintenance-mode">1. Modules In Maintenance Mode</a></h2>
|
||||
<div class="sectionbody">
|
||||
<div class="paragraph">
|
||||
<p>Placing a module in maintenance mode means that the Spring Cloud team will no longer be adding new features to the module.
|
||||
We will fix blocker bugs and security issues, and we will also consider and review small pull requests from the community.</p>
|
||||
</div>
|
||||
<div class="paragraph">
|
||||
<p>We intend to continue to support these modules for a period of at least a year from the general availability
|
||||
of the Greenwich release train.</p>
|
||||
</div>
|
||||
<div class="paragraph">
|
||||
<p>The following Spring Cloud Netflix modules and corresponding starters will be placed into maintenance mode:</p>
|
||||
</div>
|
||||
<div class="ulist">
|
||||
<ul>
|
||||
<li>
|
||||
<p>spring-cloud-netflix-archaius</p>
|
||||
</li>
|
||||
<li>
|
||||
<p>spring-cloud-netflix-concurrency-limits</p>
|
||||
</li>
|
||||
<li>
|
||||
<p>spring-cloud-netflix-hystrix-contract</p>
|
||||
</li>
|
||||
<li>
|
||||
<p>spring-cloud-netflix-hystrix-dashboard</p>
|
||||
</li>
|
||||
<li>
|
||||
<p>spring-cloud-netflix-hystrix-stream</p>
|
||||
</li>
|
||||
<li>
|
||||
<p>spring-cloud-netflix-hystrix</p>
|
||||
</li>
|
||||
<li>
|
||||
<p>spring-cloud-netflix-ribbon</p>
|
||||
</li>
|
||||
<li>
|
||||
<p>spring-cloud-netflix-turbine-stream</p>
|
||||
</li>
|
||||
<li>
|
||||
<p>spring-cloud-netflix-turbine</p>
|
||||
</li>
|
||||
<li>
|
||||
<p>spring-cloud-netflix-zuul</p>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="admonitionblock note">
|
||||
<table>
|
||||
<tr>
|
||||
<td class="icon">
|
||||
<i class="fa icon-note" title="Note"></i>
|
||||
</td>
|
||||
<td class="content">
|
||||
This does not include the Eureka modules.
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
</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/github.min.css">
|
||||
<script src="js/highlight/highlight.min.js"></script>
|
||||
<script>hljs.initHighlighting()</script>
|
||||
</body>
|
||||
</html>
|
||||
124
spring-cloud-netflix/3.0.0-M2/reference/html/sagan-boot.html
Normal file
@@ -0,0 +1,124 @@
|
||||
<!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.8">
|
||||
<title>Untitled</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};
|
||||
}
|
||||
|
||||
function globalSwitch() {
|
||||
$('.switch--item').each(function() {
|
||||
$(this).off('click');
|
||||
$(this).on('click', function() {
|
||||
selectedText = $(this).text()
|
||||
selectedIndex = $(this).index()
|
||||
$(".switch--item").filter(function() { return ($(this).text() === selectedText) }).each(function() {
|
||||
$(this).addClass('selected');
|
||||
$(this).siblings().removeClass('selected');
|
||||
selectedContent = $(this).parent().siblings(".content").eq(selectedIndex)
|
||||
selectedContent.removeClass('hidden');
|
||||
selectedContent.siblings().addClass('hidden');
|
||||
});
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
$(addBlockSwitches);
|
||||
$(globalSwitch);
|
||||
|
||||
</script>
|
||||
|
||||
</head>
|
||||
<body class="book">
|
||||
<div id="header">
|
||||
</div>
|
||||
<div id="content">
|
||||
|
||||
</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/github.min.css">
|
||||
<script src="js/highlight/highlight.min.js"></script>
|
||||
<script>hljs.initHighlighting()</script>
|
||||
</body>
|
||||
</html>
|
||||
206
spring-cloud-netflix/3.0.0-M2/reference/html/sagan-index.html
Normal file
@@ -0,0 +1,206 @@
|
||||
<!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.8">
|
||||
<title>Features</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};
|
||||
}
|
||||
|
||||
function globalSwitch() {
|
||||
$('.switch--item').each(function() {
|
||||
$(this).off('click');
|
||||
$(this).on('click', function() {
|
||||
selectedText = $(this).text()
|
||||
selectedIndex = $(this).index()
|
||||
$(".switch--item").filter(function() { return ($(this).text() === selectedText) }).each(function() {
|
||||
$(this).addClass('selected');
|
||||
$(this).siblings().removeClass('selected');
|
||||
selectedContent = $(this).parent().siblings(".content").eq(selectedIndex)
|
||||
selectedContent.removeClass('hidden');
|
||||
selectedContent.siblings().addClass('hidden');
|
||||
});
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
$(addBlockSwitches);
|
||||
$(globalSwitch);
|
||||
|
||||
</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="#_features">Features</a></li>
|
||||
<li><a href="#_getting_started">Getting Started</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div id="content">
|
||||
<div id="preamble">
|
||||
<div class="sectionbody">
|
||||
<div class="paragraph">
|
||||
<p>Spring Cloud Netflix provides Netflix OSS 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 battle-tested Netflix components. The patterns provided include Service Discovery (Eureka), Circuit Breaker (Hystrix), Intelligent Routing (Zuul) and Client Side Load Balancing (Ribbon)..</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="sect1">
|
||||
<h2 id="_features"><a class="link" href="#_features">Features</a></h2>
|
||||
<div class="sectionbody">
|
||||
<div class="paragraph">
|
||||
<p>Spring Cloud Netflix features:</p>
|
||||
</div>
|
||||
<div class="ulist">
|
||||
<ul>
|
||||
<li>
|
||||
<p>Service Discovery: Eureka instances can be registered and clients can discover the instances using Spring-managed beans</p>
|
||||
</li>
|
||||
<li>
|
||||
<p>Service Discovery: an embedded Eureka server can be created with declarative Java configuration</p>
|
||||
</li>
|
||||
<li>
|
||||
<p>Circuit Breaker: Hystrix clients can be built with a simple annotation-driven method decorator</p>
|
||||
</li>
|
||||
<li>
|
||||
<p>Circuit Breaker: embedded Hystrix dashboard with declarative Java configuration</p>
|
||||
</li>
|
||||
<li>
|
||||
<p>Declarative REST Client: Feign creates a dynamic implementation of an interface decorated with JAX-RS or Spring MVC annotations</p>
|
||||
</li>
|
||||
<li>
|
||||
<p>Client Side Load Balancer: Ribbon</p>
|
||||
</li>
|
||||
<li>
|
||||
<p>External Configuration: a bridge from the Spring Environment to Archaius (enables native configuration of Netflix components using Spring Boot conventions)</p>
|
||||
</li>
|
||||
<li>
|
||||
<p>Router and Filter: automatic registration of Zuul filters, and a simple convention over configuration approach to reverse proxy creation</p>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="sect1">
|
||||
<h2 id="_getting_started"><a class="link" href="#_getting_started">Getting Started</a></h2>
|
||||
<div class="sectionbody">
|
||||
<div class="paragraph">
|
||||
<p>As long as Spring Cloud Netflix and Eureka Core are on the
|
||||
classpath any Spring Boot application with <code>@EnableEurekaClient</code> will try to contact a Eureka
|
||||
server on <code><a href="http://localhost:8761" class="bare">http://localhost:8761</a></code> (the default value of
|
||||
<code>eureka.client.serviceUrl.defaultZone</code>):</p>
|
||||
</div>
|
||||
<div class="listingblock">
|
||||
<div class="content">
|
||||
<pre class="highlightjs highlight"><code class="language-java hljs" data-lang="java">@SpringBootApplication
|
||||
@EnableEurekaClient
|
||||
@RestController
|
||||
public class Application {
|
||||
|
||||
@RequestMapping("/")
|
||||
public String home() {
|
||||
return "Hello World";
|
||||
}
|
||||
|
||||
public static void main(String[] args) {
|
||||
SpringApplication.run(Application.class, args);
|
||||
}
|
||||
|
||||
}</code></pre>
|
||||
</div>
|
||||
</div>
|
||||
<div class="paragraph">
|
||||
<p>To run your own server use the <code>spring-cloud-starter-netflix-eureka-server</code> dependency and <code>@EnableEurekaServer</code>.</p>
|
||||
</div>
|
||||
</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/github.min.css">
|
||||
<script src="js/highlight/highlight.min.js"></script>
|
||||
<script>hljs.initHighlighting()</script>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,938 @@
|
||||
<!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.8">
|
||||
<title>Spring Cloud Netflix</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};
|
||||
}
|
||||
|
||||
function globalSwitch() {
|
||||
$('.switch--item').each(function() {
|
||||
$(this).off('click');
|
||||
$(this).on('click', function() {
|
||||
selectedText = $(this).text()
|
||||
selectedIndex = $(this).index()
|
||||
$(".switch--item").filter(function() { return ($(this).text() === selectedText) }).each(function() {
|
||||
$(this).addClass('selected');
|
||||
$(this).siblings().removeClass('selected');
|
||||
selectedContent = $(this).parent().siblings(".content").eq(selectedIndex)
|
||||
selectedContent.removeClass('hidden');
|
||||
selectedContent.siblings().addClass('hidden');
|
||||
});
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
$(addBlockSwitches);
|
||||
$(globalSwitch);
|
||||
|
||||
</script>
|
||||
|
||||
</head>
|
||||
<body class="book toc2 toc-left">
|
||||
<div id="header">
|
||||
<h1>Spring Cloud Netflix</h1>
|
||||
<div id="toc" class="toc2">
|
||||
<div id="toctitle">Table of Contents</div>
|
||||
<ul class="sectlevel1">
|
||||
<li><a href="#service-discovery-eureka-clients">1. Service Discovery: Eureka Clients</a>
|
||||
<ul class="sectlevel2">
|
||||
<li><a href="#netflix-eureka-client-starter">1.1. How to Include Eureka Client</a></li>
|
||||
<li><a href="#registering-with-eureka">1.2. Registering with Eureka</a></li>
|
||||
<li><a href="#authenticating-with-the-eureka-server">1.3. Authenticating with the Eureka Server</a></li>
|
||||
<li><a href="#status-page-and-health-indicator">1.4. Status Page and Health Indicator</a></li>
|
||||
<li><a href="#registering-a-secure-application">1.5. Registering a Secure Application</a></li>
|
||||
<li><a href="#eurekas-health-checks">1.6. Eureka’s Health Checks</a></li>
|
||||
<li><a href="#eureka-metadata-for-instances-and-clients">1.7. Eureka Metadata for Instances and Clients</a>
|
||||
<ul class="sectlevel3">
|
||||
<li><a href="#using-eureka-on-cloud-foundry">1.7.1. Using Eureka on Cloud Foundry</a></li>
|
||||
<li><a href="#using-eureka-on-aws">1.7.2. Using Eureka on AWS</a></li>
|
||||
<li><a href="#changing-the-eureka-instance-id">1.7.3. Changing the Eureka Instance ID</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li><a href="#using-the-eurekaclient">1.8. Using the EurekaClient</a>
|
||||
<ul class="sectlevel3">
|
||||
<li><a href="#eurekaclient-without-jersey">1.8.1. EurekaClient without Jersey</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li><a href="#alternatives-to-the-native-netflix-eurekaclient">1.9. Alternatives to the Native Netflix EurekaClient</a></li>
|
||||
<li><a href="#why-is-it-so-slow-to-register-a-service">1.10. Why Is It so Slow to Register a Service?</a></li>
|
||||
<li><a href="#zones">1.11. Zones</a></li>
|
||||
<li><a href="#refreshing-eureka-clients">1.12. Refreshing Eureka Clients</a></li>
|
||||
<li><a href="#using-eureka-with-spring-cloud-loadbalancer">1.13. Using Eureka with Spring Cloud LoadBalancer</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li><a href="#spring-cloud-eureka-server">2. Service Discovery: Eureka Server</a>
|
||||
<ul class="sectlevel2">
|
||||
<li><a href="#netflix-eureka-server-starter">2.1. How to Include Eureka Server</a></li>
|
||||
<li><a href="#spring-cloud-running-eureka-server">2.2. How to Run a Eureka Server</a></li>
|
||||
<li><a href="#spring-cloud-eureka-server-zones-and-regions">2.3. High Availability, Zones and Regions</a></li>
|
||||
<li><a href="#spring-cloud-eureka-server-standalone-mode">2.4. Standalone Mode</a></li>
|
||||
<li><a href="#spring-cloud-eureka-server-peer-awareness">2.5. Peer Awareness</a></li>
|
||||
<li><a href="#spring-cloud-eureka-server-prefer-ip-address">2.6. When to Prefer IP Address</a></li>
|
||||
<li><a href="#securing-the-eureka-server">2.7. Securing The Eureka Server</a></li>
|
||||
<li><a href="#jdk-11-support">2.8. JDK 11 Support</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li><a href="#configuration-properties">3. Configuration properties</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div id="content">
|
||||
<div id="preamble">
|
||||
<div class="sectionbody">
|
||||
<div class="paragraph">
|
||||
<p><strong>3.0.0-M2</strong></p>
|
||||
</div>
|
||||
<div class="paragraph">
|
||||
<p>This project provides Netflix OSS 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 battle-tested Netflix components. The
|
||||
patterns provided include Service Discovery (Eureka), Circuit Breaker (Hystrix),
|
||||
Intelligent Routing (Zuul) and Client Side Load Balancing (Ribbon).</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="sect1">
|
||||
<h2 id="service-discovery-eureka-clients"><a class="anchor" href="#service-discovery-eureka-clients"></a><a class="link" href="#service-discovery-eureka-clients">1. Service Discovery: Eureka Clients</a></h2>
|
||||
<div class="sectionbody">
|
||||
<div class="paragraph">
|
||||
<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 difficult to do and can be brittle.
|
||||
Eureka is the Netflix Service Discovery Server and Client.
|
||||
The server can be configured and deployed to be highly available, with each server replicating state about the registered services to the others.</p>
|
||||
</div>
|
||||
<div class="sect2">
|
||||
<h3 id="netflix-eureka-client-starter"><a class="anchor" href="#netflix-eureka-client-starter"></a><a class="link" href="#netflix-eureka-client-starter">1.1. How to Include Eureka Client</a></h3>
|
||||
<div class="paragraph">
|
||||
<p>To include the Eureka Client in your project, use the starter with a group ID of <code>org.springframework.cloud</code> and an artifact ID of <code>spring-cloud-starter-netflix-eureka-client</code>.
|
||||
See the <a href="https://projects.spring.io/spring-cloud/">Spring Cloud Project page</a> for details on setting up your build system with the current Spring Cloud Release Train.</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="sect2">
|
||||
<h3 id="registering-with-eureka"><a class="anchor" href="#registering-with-eureka"></a><a class="link" href="#registering-with-eureka">1.2. Registering with Eureka</a></h3>
|
||||
<div class="paragraph">
|
||||
<p>When a client registers with Eureka, it provides meta-data about itself — such as host, port, health indicator URL, home page, and other details.
|
||||
Eureka receives heartbeat messages from each instance belonging to a service.
|
||||
If the heartbeat fails over a configurable timetable, the instance is normally removed from the registry.</p>
|
||||
</div>
|
||||
<div class="paragraph">
|
||||
<p>The following example shows a minimal Eureka client application:</p>
|
||||
</div>
|
||||
<div class="listingblock">
|
||||
<div class="content">
|
||||
<pre class="highlightjs highlight"><code class="language-java hljs" data-lang="java">@SpringBootApplication
|
||||
@RestController
|
||||
public class Application {
|
||||
|
||||
@RequestMapping("/")
|
||||
public String home() {
|
||||
return "Hello world";
|
||||
}
|
||||
|
||||
public static void main(String[] args) {
|
||||
new SpringApplicationBuilder(Application.class).web(true).run(args);
|
||||
}
|
||||
|
||||
}</code></pre>
|
||||
</div>
|
||||
</div>
|
||||
<div class="paragraph">
|
||||
<p>Note that the preceding example shows a normal <a href="https://projects.spring.io/spring-boot/">Spring Boot</a> application.
|
||||
By having <code>spring-cloud-starter-netflix-eureka-client</code> on the classpath, your application automatically registers with the Eureka Server. Configuration is required to locate the Eureka server, as shown in the following example:</p>
|
||||
</div>
|
||||
<div class="listingblock">
|
||||
<div class="title">application.yml</div>
|
||||
<div class="content">
|
||||
<pre>eureka:
|
||||
client:
|
||||
serviceUrl:
|
||||
defaultZone: http://localhost:8761/eureka/</pre>
|
||||
</div>
|
||||
</div>
|
||||
<div class="paragraph">
|
||||
<p>In the preceding example, <code>defaultZone</code> is a magic string fallback value that provides the service URL for any client that does not express a preference (in other words, it is a useful default).</p>
|
||||
</div>
|
||||
<div class="admonitionblock warning">
|
||||
<table>
|
||||
<tr>
|
||||
<td class="icon">
|
||||
<i class="fa icon-warning" title="Warning"></i>
|
||||
</td>
|
||||
<td class="content">
|
||||
The <code>defaultZone</code> property is case sensitive and requires camel case because the <code>serviceUrl</code> property is a <code>Map<String, String></code>. Therefore, the <code>defaultZone</code> property does not follow the normal Spring Boot snake-case convention of <code>default-zone</code>.
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
<div class="paragraph">
|
||||
<p>The default application name (that is, the service ID), virtual host, and non-secure port (taken from the <code>Environment</code>) are <code>${spring.application.name}</code>, <code>${spring.application.name}</code> and <code>${server.port}</code>, respectively.</p>
|
||||
</div>
|
||||
<div class="paragraph">
|
||||
<p>Having <code>spring-cloud-starter-netflix-eureka-client</code> on the classpath makes the app into both a Eureka “instance” (that is, it registers itself) and a “client” (it can query the registry to locate other services).
|
||||
The instance behaviour is driven by <code>eureka.instance.*</code> configuration keys, but the defaults are fine if you ensure that your application has a value for <code>spring.application.name</code> (this is the default for the Eureka service ID or VIP).</p>
|
||||
</div>
|
||||
<div class="paragraph">
|
||||
<p>See <a href="https://github.com/spring-cloud/spring-cloud-netflix/tree/master/spring-cloud-netflix-eureka-client/src/main/java/org/springframework/cloud/netflix/eureka/EurekaInstanceConfigBean.java">EurekaInstanceConfigBean</a> and <a href="https://github.com/spring-cloud/spring-cloud-netflix/tree/master/spring-cloud-netflix-eureka-client/src/main/java/org/springframework/cloud/netflix/eureka/EurekaClientConfigBean.java">EurekaClientConfigBean</a> for more details on the configurable options.</p>
|
||||
</div>
|
||||
<div class="paragraph">
|
||||
<p>To disable the Eureka Discovery Client, you can set <code>eureka.client.enabled</code> to <code>false</code>. Eureka Discovery Client will also be disabled when <code>spring.cloud.discovery.enabled</code> is set to <code>false</code>.</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="sect2">
|
||||
<h3 id="authenticating-with-the-eureka-server"><a class="anchor" href="#authenticating-with-the-eureka-server"></a><a class="link" href="#authenticating-with-the-eureka-server">1.3. Authenticating with the Eureka Server</a></h3>
|
||||
<div class="paragraph">
|
||||
<p>HTTP basic authentication is automatically added to your eureka client if one of the <code>eureka.client.serviceUrl.defaultZone</code> URLs has credentials embedded in it (curl style, as follows: <code><a href="https://user:password@localhost:8761/eureka" class="bare">user:password@localhost:8761/eureka</a></code>).
|
||||
For more complex needs, you can create a <code>@Bean</code> of type <code>DiscoveryClientOptionalArgs</code> and inject <code>ClientFilter</code> instances into it, all of which is applied to the calls from the client to the server.</p>
|
||||
</div>
|
||||
<div class="admonitionblock note">
|
||||
<table>
|
||||
<tr>
|
||||
<td class="icon">
|
||||
<i class="fa icon-note" title="Note"></i>
|
||||
</td>
|
||||
<td class="content">
|
||||
Because of a limitation in Eureka, it is not possible to support per-server basic auth credentials, so only the first set that are found is used.
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
<div class="sect2">
|
||||
<h3 id="status-page-and-health-indicator"><a class="anchor" href="#status-page-and-health-indicator"></a><a class="link" href="#status-page-and-health-indicator">1.4. Status Page and Health Indicator</a></h3>
|
||||
<div class="paragraph">
|
||||
<p>The status page and health indicators for a Eureka instance default to <code>/info</code> and <code>/health</code> respectively, which are the default locations of useful endpoints in a Spring Boot Actuator application.
|
||||
You need to change these, even for an Actuator application if you use a non-default context path or servlet path (such as <code>server.servletPath=/custom</code>). The following example shows the default values for the two settings:</p>
|
||||
</div>
|
||||
<div class="listingblock">
|
||||
<div class="title">application.yml</div>
|
||||
<div class="content">
|
||||
<pre>eureka:
|
||||
instance:
|
||||
statusPageUrlPath: ${server.servletPath}/info
|
||||
healthCheckUrlPath: ${server.servletPath}/health</pre>
|
||||
</div>
|
||||
</div>
|
||||
<div class="paragraph">
|
||||
<p>These links show up in the metadata that is consumed by clients and are used in some scenarios to decide whether to send requests to your application, so it is helpful if they are accurate.</p>
|
||||
</div>
|
||||
<div class="admonitionblock note">
|
||||
<table>
|
||||
<tr>
|
||||
<td class="icon">
|
||||
<i class="fa icon-note" title="Note"></i>
|
||||
</td>
|
||||
<td class="content">
|
||||
In Dalston it was also required to set the status and health check URLs when changing
|
||||
that management context path. This requirement was removed beginning in Edgware.
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
<div class="sect2">
|
||||
<h3 id="registering-a-secure-application"><a class="anchor" href="#registering-a-secure-application"></a><a class="link" href="#registering-a-secure-application">1.5. Registering a Secure Application</a></h3>
|
||||
<div class="paragraph">
|
||||
<p>If your app wants to be contacted over HTTPS, you can set two flags in the <code>EurekaInstanceConfig</code>:</p>
|
||||
</div>
|
||||
<div class="ulist">
|
||||
<ul>
|
||||
<li>
|
||||
<p><code>eureka.instance.[nonSecurePortEnabled]=[false]</code></p>
|
||||
</li>
|
||||
<li>
|
||||
<p><code>eureka.instance.[securePortEnabled]=[true]</code></p>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="paragraph">
|
||||
<p>Doing so makes Eureka publish instance information that shows an explicit preference for secure communication.
|
||||
The Spring Cloud <code>DiscoveryClient</code> always returns a URI starting with <code>https</code> for a service configured this way.
|
||||
Similarly, when a service is configured this way, the Eureka (native) instance information has a secure health check URL.</p>
|
||||
</div>
|
||||
<div class="paragraph">
|
||||
<p>Because of the way Eureka works internally, it still publishes a non-secure URL for the status and home pages unless you also override those explicitly.
|
||||
You can use placeholders to configure the eureka instance URLs, as shown in the following example:</p>
|
||||
</div>
|
||||
<div class="listingblock">
|
||||
<div class="title">application.yml</div>
|
||||
<div class="content">
|
||||
<pre>eureka:
|
||||
instance:
|
||||
statusPageUrl: https://${eureka.hostname}/info
|
||||
healthCheckUrl: https://${eureka.hostname}/health
|
||||
homePageUrl: https://${eureka.hostname}/</pre>
|
||||
</div>
|
||||
</div>
|
||||
<div class="paragraph">
|
||||
<p>(Note that <code>${eureka.hostname}</code> is a native placeholder only available
|
||||
in later versions of Eureka. You could achieve the same thing with
|
||||
Spring placeholders as well — for example, by using <code>${eureka.instance.hostName}</code>.)</p>
|
||||
</div>
|
||||
<div class="admonitionblock note">
|
||||
<table>
|
||||
<tr>
|
||||
<td class="icon">
|
||||
<i class="fa icon-note" title="Note"></i>
|
||||
</td>
|
||||
<td class="content">
|
||||
If your application runs behind a proxy, and the SSL termination is in the proxy (for example, if you run in Cloud Foundry or other platforms as a service), then you need to ensure that the proxy “forwarded” headers are intercepted and handled by the application.
|
||||
If the Tomcat container embedded in a Spring Boot application has explicit configuration for the 'X-Forwarded-\*` headers, this happens automatically.
|
||||
The links rendered by your app to itself being wrong (the wrong host, port, or protocol) is a sign that you got this configuration wrong.
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
<div class="sect2">
|
||||
<h3 id="eurekas-health-checks"><a class="anchor" href="#eurekas-health-checks"></a><a class="link" href="#eurekas-health-checks">1.6. Eureka’s Health Checks</a></h3>
|
||||
<div class="paragraph">
|
||||
<p>By default, Eureka uses the client heartbeat to determine if a client is up.
|
||||
Unless specified otherwise, the Discovery Client does not propagate the current health check status of the application, per the Spring Boot Actuator.
|
||||
Consequently, after successful registration, Eureka always announces that the application is in 'UP' state. This behavior can be altered by enabling Eureka health checks, which results in propagating application status to Eureka.
|
||||
As a consequence, every other application does not send traffic to applications in states other then 'UP'.
|
||||
The following example shows how to enable health checks for the client:</p>
|
||||
</div>
|
||||
<div class="listingblock">
|
||||
<div class="title">application.yml</div>
|
||||
<div class="content">
|
||||
<pre>eureka:
|
||||
client:
|
||||
healthcheck:
|
||||
enabled: true</pre>
|
||||
</div>
|
||||
</div>
|
||||
<div class="admonitionblock warning">
|
||||
<table>
|
||||
<tr>
|
||||
<td class="icon">
|
||||
<i class="fa icon-warning" title="Warning"></i>
|
||||
</td>
|
||||
<td class="content">
|
||||
<code>eureka.client.healthcheck.enabled=true</code> should only be set in <code>application.yml</code>. Setting the value in <code>bootstrap.yml</code> causes undesirable side effects, such as registering in Eureka with an <code>UNKNOWN</code> status.
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
<div class="paragraph">
|
||||
<p>If you require more control over the health checks, consider implementing your own <code>com.netflix.appinfo.HealthCheckHandler</code>.</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="sect2">
|
||||
<h3 id="eureka-metadata-for-instances-and-clients"><a class="anchor" href="#eureka-metadata-for-instances-and-clients"></a><a class="link" href="#eureka-metadata-for-instances-and-clients">1.7. Eureka Metadata for Instances and Clients</a></h3>
|
||||
<div class="paragraph">
|
||||
<p>It is worth spending a bit of time understanding how the Eureka metadata works, so you can use it in a way that makes sense in your platform.
|
||||
There is standard metadata for information such as hostname, IP address, port numbers, the status page, and health check.
|
||||
These are published in the service registry and used by clients to contact the services in a straightforward way.
|
||||
Additional metadata can be added to the instance registration in the <code>eureka.instance.metadataMap</code>, and this metadata is accessible in the remote clients.
|
||||
In general, additional metadata does not change the behavior of the client, unless the client is made aware of the meaning of the metadata.
|
||||
There are a couple of special cases, described later in this document, where Spring Cloud already assigns meaning to the metadata map.</p>
|
||||
</div>
|
||||
<div class="sect3">
|
||||
<h4 id="using-eureka-on-cloud-foundry"><a class="anchor" href="#using-eureka-on-cloud-foundry"></a><a class="link" href="#using-eureka-on-cloud-foundry">1.7.1. Using Eureka on Cloud Foundry</a></h4>
|
||||
<div class="paragraph">
|
||||
<p>Cloud Foundry has a global router so that all instances of the same app have the same hostname (other PaaS solutions with a similar architecture have the same arrangement).
|
||||
This is not necessarily a barrier to using Eureka.
|
||||
However, if you use the router (recommended or even mandatory, depending on the way your platform was set up), you need to explicitly set the hostname and port numbers (secure or non-secure) so that they use the router.
|
||||
You might also want to use instance metadata so that you can distinguish between the instances on the client (for example, in a custom load balancer).
|
||||
By default, the <code>eureka.instance.instanceId</code> is <code>vcap.application.instance_id</code>, as shown in the following example:</p>
|
||||
</div>
|
||||
<div class="listingblock">
|
||||
<div class="title">application.yml</div>
|
||||
<div class="content">
|
||||
<pre>eureka:
|
||||
instance:
|
||||
hostname: ${vcap.application.uris[0]}
|
||||
nonSecurePort: 80</pre>
|
||||
</div>
|
||||
</div>
|
||||
<div class="paragraph">
|
||||
<p>Depending on the way the security rules are set up in your Cloud Foundry instance, you might be able to register and use the IP address of the host VM for direct service-to-service calls.
|
||||
This feature is not yet available on Pivotal Web Services (<a href="https://run.pivotal.io">PWS</a>).</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="sect3">
|
||||
<h4 id="using-eureka-on-aws"><a class="anchor" href="#using-eureka-on-aws"></a><a class="link" href="#using-eureka-on-aws">1.7.2. Using Eureka on AWS</a></h4>
|
||||
<div class="paragraph">
|
||||
<p>If the application is planned to be deployed to an AWS cloud, the Eureka instance must be configured to be AWS-aware. You can do so by customizing the <a href="https://github.com/spring-cloud/spring-cloud-netflix/tree/master/spring-cloud-netflix-eureka-client/src/main/java/org/springframework/cloud/netflix/eureka/EurekaInstanceConfigBean.java">EurekaInstanceConfigBean</a> as follows:</p>
|
||||
</div>
|
||||
<div class="listingblock">
|
||||
<div class="content">
|
||||
<pre class="highlightjs highlight"><code class="language-java hljs" data-lang="java">@Bean
|
||||
@Profile("!default")
|
||||
public EurekaInstanceConfigBean eurekaInstanceConfig(InetUtils inetUtils) {
|
||||
EurekaInstanceConfigBean b = new EurekaInstanceConfigBean(inetUtils);
|
||||
AmazonInfo info = AmazonInfo.Builder.newBuilder().autoBuild("eureka");
|
||||
b.setDataCenterInfo(info);
|
||||
return b;
|
||||
}</code></pre>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="sect3">
|
||||
<h4 id="changing-the-eureka-instance-id"><a class="anchor" href="#changing-the-eureka-instance-id"></a><a class="link" href="#changing-the-eureka-instance-id">1.7.3. Changing the Eureka Instance ID</a></h4>
|
||||
<div class="paragraph">
|
||||
<p>A vanilla Netflix Eureka instance is registered with an ID that is equal to its host name (that is, there is only one service per host).
|
||||
Spring Cloud Eureka provides a sensible default, which is defined as follows:</p>
|
||||
</div>
|
||||
<div class="paragraph">
|
||||
<p><code>${spring.cloud.client.hostname}:${spring.application.name}:${spring.application.instance_id:${server.port}}}</code></p>
|
||||
</div>
|
||||
<div class="paragraph">
|
||||
<p>An example is <code>myhost:myappname:8080</code>.</p>
|
||||
</div>
|
||||
<div class="paragraph">
|
||||
<p>By using Spring Cloud, you can override this value by providing a unique identifier in <code>eureka.instance.instanceId</code>, as shown in the following example:</p>
|
||||
</div>
|
||||
<div class="listingblock">
|
||||
<div class="title">application.yml</div>
|
||||
<div class="content">
|
||||
<pre>eureka:
|
||||
instance:
|
||||
instanceId: ${spring.application.name}:${vcap.application.instance_id:${spring.application.instance_id:${random.value}}}</pre>
|
||||
</div>
|
||||
</div>
|
||||
<div class="paragraph">
|
||||
<p>With the metadata shown in the preceding example and multiple service instances deployed on localhost, the random value is inserted there to make the instance unique.
|
||||
In Cloud Foundry, the <code>vcap.application.instance_id</code> is populated automatically in a Spring Boot application, so the random value is not needed.</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="sect2">
|
||||
<h3 id="using-the-eurekaclient"><a class="anchor" href="#using-the-eurekaclient"></a><a class="link" href="#using-the-eurekaclient">1.8. Using the EurekaClient</a></h3>
|
||||
<div class="paragraph">
|
||||
<p>Once you have an application that is a discovery client, you can use it to discover service instances from the <a href="#spring-cloud-eureka-server">Eureka Server</a>.
|
||||
One way to do so is to use the native <code>com.netflix.discovery.EurekaClient</code> (as opposed to the Spring Cloud <code>DiscoveryClient</code>), as shown in the following example:</p>
|
||||
</div>
|
||||
<div class="listingblock">
|
||||
<div class="content">
|
||||
<pre>@Autowired
|
||||
private EurekaClient discoveryClient;
|
||||
|
||||
public String serviceUrl() {
|
||||
InstanceInfo instance = discoveryClient.getNextServerFromEureka("STORES", false);
|
||||
return instance.getHomePageUrl();
|
||||
}</pre>
|
||||
</div>
|
||||
</div>
|
||||
<div class="admonitionblock tip">
|
||||
<table>
|
||||
<tr>
|
||||
<td class="icon">
|
||||
<i class="fa icon-tip" title="Tip"></i>
|
||||
</td>
|
||||
<td class="content">
|
||||
<div class="paragraph">
|
||||
<p>Do not use the <code>EurekaClient</code> in a <code>@PostConstruct</code> method or in a <code>@Scheduled</code> method (or anywhere where the <code>ApplicationContext</code> might not be started yet).
|
||||
It is initialized in a <code>SmartLifecycle</code> (with <code>phase=0</code>), so the earliest you can rely on it being available is in another <code>SmartLifecycle</code> with a higher phase.</p>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
<div class="sect3">
|
||||
<h4 id="eurekaclient-without-jersey"><a class="anchor" href="#eurekaclient-without-jersey"></a><a class="link" href="#eurekaclient-without-jersey">1.8.1. EurekaClient without Jersey</a></h4>
|
||||
<div class="paragraph">
|
||||
<p>By default, EurekaClient uses Jersey for HTTP communication.
|
||||
If you wish to avoid dependencies from Jersey, you can exclude it from your dependencies.
|
||||
Spring Cloud auto-configures a transport client based on Spring <code>RestTemplate</code>.
|
||||
The following example shows Jersey being excluded:</p>
|
||||
</div>
|
||||
<div class="listingblock">
|
||||
<div class="content">
|
||||
<pre><dependency>
|
||||
<groupId>org.springframework.cloud</groupId>
|
||||
<artifactId>spring-cloud-starter-netflix-eureka-client</artifactId>
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
<groupId>com.sun.jersey</groupId>
|
||||
<artifactId>jersey-client</artifactId>
|
||||
</exclusion>
|
||||
<exclusion>
|
||||
<groupId>com.sun.jersey</groupId>
|
||||
<artifactId>jersey-core</artifactId>
|
||||
</exclusion>
|
||||
<exclusion>
|
||||
<groupId>com.sun.jersey.contribs</groupId>
|
||||
<artifactId>jersey-apache-client4</artifactId>
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency></pre>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="sect2">
|
||||
<h3 id="alternatives-to-the-native-netflix-eurekaclient"><a class="anchor" href="#alternatives-to-the-native-netflix-eurekaclient"></a><a class="link" href="#alternatives-to-the-native-netflix-eurekaclient">1.9. Alternatives to the Native Netflix EurekaClient</a></h3>
|
||||
<div class="paragraph">
|
||||
<p>You need not use the raw Netflix <code>EurekaClient</code>.
|
||||
Also, it is usually more convenient to use it behind a wrapper of some sort.
|
||||
Spring Cloud has support for <a href="#spring-cloud-feign">Feign</a> (a REST client builder) and <a href="#spring-cloud-ribbon">Spring <code>RestTemplate</code></a> through the logical Eureka service identifiers (VIPs) instead of physical URLs.
|
||||
To configure Ribbon with a fixed list of physical servers, you can set <code><client>.ribbon.listOfServers</code> to a comma-separated list of physical addresses (or hostnames), where <code><client></code> is the ID of the client.</p>
|
||||
</div>
|
||||
<div class="paragraph">
|
||||
<p>You can also use the <code>org.springframework.cloud.client.discovery.DiscoveryClient</code>, which provides a simple API (not specific to Netflix) for discovery clients, as shown in the following example:</p>
|
||||
</div>
|
||||
<div class="listingblock">
|
||||
<div class="content">
|
||||
<pre>@Autowired
|
||||
private DiscoveryClient discoveryClient;
|
||||
|
||||
public String serviceUrl() {
|
||||
List<ServiceInstance> list = discoveryClient.getInstances("STORES");
|
||||
if (list != null && list.size() > 0 ) {
|
||||
return list.get(0).getUri();
|
||||
}
|
||||
return null;
|
||||
}</pre>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="sect2">
|
||||
<h3 id="why-is-it-so-slow-to-register-a-service"><a class="anchor" href="#why-is-it-so-slow-to-register-a-service"></a><a class="link" href="#why-is-it-so-slow-to-register-a-service">1.10. Why Is It so Slow to Register a Service?</a></h3>
|
||||
<div class="paragraph">
|
||||
<p>Being an instance also involves a periodic heartbeat to the registry
|
||||
(through the client’s <code>serviceUrl</code>) with a default duration of 30 seconds.
|
||||
A service is not available for discovery by clients until the instance, the server, and the client all have the same metadata in their local
|
||||
cache (so it could take 3 heartbeats).
|
||||
You can change the period by setting <code>eureka.instance.leaseRenewalIntervalInSeconds</code>.
|
||||
Setting it to a value of less than 30 speeds up the process of getting clients connected to other services.
|
||||
In production, it is probably better to stick with the default, because of internal computations in the server that make assumptions about the lease renewal period.</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="sect2">
|
||||
<h3 id="zones"><a class="anchor" href="#zones"></a><a class="link" href="#zones">1.11. Zones</a></h3>
|
||||
<div class="paragraph">
|
||||
<p>If you have deployed Eureka clients to multiple zones, you may prefer that those clients use services within the same zone before trying services in another zone.
|
||||
To set that up, you need to configure your Eureka clients correctly.</p>
|
||||
</div>
|
||||
<div class="paragraph">
|
||||
<p>First, you need to make sure you have Eureka servers deployed to each zone and that
|
||||
they are peers of each other.
|
||||
See the section on <a href="#spring-cloud-eureka-server-zones-and-regions">zones and regions</a>
|
||||
for more information.</p>
|
||||
</div>
|
||||
<div class="paragraph">
|
||||
<p>Next, you need to tell Eureka which zone your service is in.
|
||||
You can do so by using the <code>metadataMap</code> property.
|
||||
For example, if <code>service 1</code> is deployed to both <code>zone 1</code> and <code>zone 2</code>, you need to set the following Eureka properties in <code>service 1</code>:</p>
|
||||
</div>
|
||||
<div class="paragraph">
|
||||
<p><strong>Service 1 in Zone 1</strong></p>
|
||||
</div>
|
||||
<div class="listingblock">
|
||||
<div class="content">
|
||||
<pre class="highlightjs highlight"><code>eureka.instance.metadataMap.zone = zone1
|
||||
eureka.client.preferSameZoneEureka = true</code></pre>
|
||||
</div>
|
||||
</div>
|
||||
<div class="paragraph">
|
||||
<p><strong>Service 1 in Zone 2</strong></p>
|
||||
</div>
|
||||
<div class="listingblock">
|
||||
<div class="content">
|
||||
<pre class="highlightjs highlight"><code>eureka.instance.metadataMap.zone = zone2
|
||||
eureka.client.preferSameZoneEureka = true</code></pre>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="sect2">
|
||||
<h3 id="refreshing-eureka-clients"><a class="anchor" href="#refreshing-eureka-clients"></a><a class="link" href="#refreshing-eureka-clients">1.12. Refreshing Eureka Clients</a></h3>
|
||||
<div class="paragraph">
|
||||
<p>By default, the <code>EurekaClient</code> bean is refreshable, meaning the Eureka client properties can be changed and refreshed.
|
||||
When a refresh occurs clients will be unregistered from the Eureka server and there might be a brief moment of time
|
||||
where all instance of a given service are not available. One way to eliminate this from happening is to disable
|
||||
the ability to refresh Eureka clients. To do this set <code>eureka.client.refresh.enable=false</code>.</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="sect2">
|
||||
<h3 id="using-eureka-with-spring-cloud-loadbalancer"><a class="anchor" href="#using-eureka-with-spring-cloud-loadbalancer"></a><a class="link" href="#using-eureka-with-spring-cloud-loadbalancer">1.13. Using Eureka with Spring Cloud LoadBalancer</a></h3>
|
||||
<div class="paragraph">
|
||||
<p>We offer support for the Spring Cloud LoadBalancer <code>ZonePreferenceServiceInstanceListSupplier</code>.
|
||||
The <code>zone</code> value from the Eureka instance metadata (<code>eureka.instance.metadataMap.zone</code>) is used for setting the
|
||||
value of <code>spring-clod-loadbalancer-zone</code> property that is used to filter service instances by zone.</p>
|
||||
</div>
|
||||
<div class="paragraph">
|
||||
<p>If that is missing and if the <code>spring.cloud.loadbalancer.eureka.approximateZoneFromHostname</code> flag is set to <code>true</code>,
|
||||
it can use the domain name from the server hostname as a proxy for the zone.</p>
|
||||
</div>
|
||||
<div class="paragraph">
|
||||
<p>If there is no other source of zone data, then a guess is made, based on the client configuration (as opposed to the instance configuration).
|
||||
We take <code>eureka.client.availabilityZones</code>, which is a map from region name to a list of zones, and pull out the first zone for the instance’s own region (that is, the <code>eureka.client.region</code>, which defaults to "us-east-1", for compatibility with native Netflix).</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="sect1">
|
||||
<h2 id="spring-cloud-eureka-server"><a class="anchor" href="#spring-cloud-eureka-server"></a><a class="link" href="#spring-cloud-eureka-server">2. Service Discovery: Eureka Server</a></h2>
|
||||
<div class="sectionbody">
|
||||
<div class="paragraph">
|
||||
<p>This section describes how to set up a Eureka server.</p>
|
||||
</div>
|
||||
<div class="sect2">
|
||||
<h3 id="netflix-eureka-server-starter"><a class="anchor" href="#netflix-eureka-server-starter"></a><a class="link" href="#netflix-eureka-server-starter">2.1. How to Include Eureka Server</a></h3>
|
||||
<div class="paragraph">
|
||||
<p>To include Eureka Server in your project, use the starter with a group ID of <code>org.springframework.cloud</code> and an artifact ID of <code>spring-cloud-starter-netflix-eureka-server</code>.
|
||||
See the <a href="https://projects.spring.io/spring-cloud/">Spring Cloud Project page</a> for details on setting up your build system with the current Spring Cloud Release Train.</p>
|
||||
</div>
|
||||
<div class="admonitionblock note">
|
||||
<table>
|
||||
<tr>
|
||||
<td class="icon">
|
||||
<i class="fa icon-note" title="Note"></i>
|
||||
</td>
|
||||
<td class="content">
|
||||
If your project already uses Thymeleaf as its template engine, the Freemarker templates of the Eureka server may not be loaded correctly. In this case it is necessary to configure the template loader manually:
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
<div class="listingblock">
|
||||
<div class="title">application.yml</div>
|
||||
<div class="content">
|
||||
<pre>spring:
|
||||
freemarker:
|
||||
template-loader-path: classpath:/templates/
|
||||
prefer-file-system-access: false</pre>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="sect2">
|
||||
<h3 id="spring-cloud-running-eureka-server"><a class="anchor" href="#spring-cloud-running-eureka-server"></a><a class="link" href="#spring-cloud-running-eureka-server">2.2. How to Run a Eureka Server</a></h3>
|
||||
<div class="paragraph">
|
||||
<p>The following example shows a minimal Eureka server:</p>
|
||||
</div>
|
||||
<div class="listingblock">
|
||||
<div class="content">
|
||||
<pre class="highlightjs highlight"><code class="language-java hljs" data-lang="java">@SpringBootApplication
|
||||
@EnableEurekaServer
|
||||
public class Application {
|
||||
|
||||
public static void main(String[] args) {
|
||||
new SpringApplicationBuilder(Application.class).web(true).run(args);
|
||||
}
|
||||
|
||||
}</code></pre>
|
||||
</div>
|
||||
</div>
|
||||
<div class="paragraph">
|
||||
<p>The server has a home page with a UI and HTTP API endpoints for the normal Eureka functionality under <code>/eureka/*</code>.</p>
|
||||
</div>
|
||||
<div class="paragraph">
|
||||
<p>The following links have some Eureka background reading: <a href="https://github.com/cfregly/fluxcapacitor/wiki/NetflixOSS-FAQ#eureka-service-discovery-load-balancer">flux capacitor</a> and <a href="https://groups.google.com/forum/?fromgroups#!topic/eureka_netflix/g3p2r7gHnN0">google group discussion</a>.</p>
|
||||
</div>
|
||||
<div class="admonitionblock tip">
|
||||
<table>
|
||||
<tr>
|
||||
<td class="icon">
|
||||
<i class="fa icon-tip" title="Tip"></i>
|
||||
</td>
|
||||
<td class="content">
|
||||
<div class="paragraph">
|
||||
<p>Due to Gradle’s dependency resolution rules and the lack of a parent bom feature, depending on <code>spring-cloud-starter-netflix-eureka-server</code> can cause failures on application startup.
|
||||
To remedy this issue, add the Spring Boot Gradle plugin and import the Spring cloud starter parent bom as follows:</p>
|
||||
</div>
|
||||
<div class="listingblock">
|
||||
<div class="title">build.gradle</div>
|
||||
<div class="content">
|
||||
<pre class="highlightjs highlight"><code class="language-java hljs" data-lang="java">buildscript {
|
||||
dependencies {
|
||||
classpath("org.springframework.boot:spring-boot-gradle-plugin:{spring-boot-docs-version}")
|
||||
}
|
||||
}
|
||||
|
||||
apply plugin: "spring-boot"
|
||||
|
||||
dependencyManagement {
|
||||
imports {
|
||||
mavenBom "org.springframework.cloud:spring-cloud-dependencies:{spring-cloud-version}"
|
||||
}
|
||||
}</code></pre>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
<div class="sect2">
|
||||
<h3 id="spring-cloud-eureka-server-zones-and-regions"><a class="anchor" href="#spring-cloud-eureka-server-zones-and-regions"></a><a class="link" href="#spring-cloud-eureka-server-zones-and-regions">2.3. High Availability, Zones and Regions</a></h3>
|
||||
<div class="paragraph">
|
||||
<p>The Eureka server does not have a back end store, but the service instances in the registry all have to send heartbeats to keep their registrations up to date (so this can be done in memory).
|
||||
Clients also have an in-memory cache of Eureka registrations (so they do not have to go to the registry for every request to a service).</p>
|
||||
</div>
|
||||
<div class="paragraph">
|
||||
<p>By default, every Eureka server is also a Eureka client and requires (at least one) service URL to locate a peer.
|
||||
If you do not provide it, the service runs and works, but it fills your logs with a lot of noise about not being able to register with the peer.</p>
|
||||
</div>
|
||||
<div class="paragraph">
|
||||
<p>See also <a href="#spring-cloud-ribbon">below for details of Ribbon support</a> on the client side for Zones and Regions.</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="sect2">
|
||||
<h3 id="spring-cloud-eureka-server-standalone-mode"><a class="anchor" href="#spring-cloud-eureka-server-standalone-mode"></a><a class="link" href="#spring-cloud-eureka-server-standalone-mode">2.4. Standalone Mode</a></h3>
|
||||
<div class="paragraph">
|
||||
<p>The combination of the two caches (client and server) and the heartbeats make a standalone Eureka server fairly resilient to failure, as long as there is some sort of monitor or elastic runtime (such as Cloud Foundry) keeping it alive.
|
||||
In standalone mode, you might prefer to switch off the client side behavior so that it does not keep trying and failing to reach its peers.
|
||||
The following example shows how to switch off the client-side behavior:</p>
|
||||
</div>
|
||||
<div class="listingblock">
|
||||
<div class="title">application.yml (Standalone Eureka Server)</div>
|
||||
<div class="content">
|
||||
<pre>server:
|
||||
port: 8761
|
||||
|
||||
eureka:
|
||||
instance:
|
||||
hostname: localhost
|
||||
client:
|
||||
registerWithEureka: false
|
||||
fetchRegistry: false
|
||||
serviceUrl:
|
||||
defaultZone: http://${eureka.instance.hostname}:${server.port}/eureka/</pre>
|
||||
</div>
|
||||
</div>
|
||||
<div class="paragraph">
|
||||
<p>Notice that the <code>serviceUrl</code> is pointing to the same host as the local instance.</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="sect2">
|
||||
<h3 id="spring-cloud-eureka-server-peer-awareness"><a class="anchor" href="#spring-cloud-eureka-server-peer-awareness"></a><a class="link" href="#spring-cloud-eureka-server-peer-awareness">2.5. Peer Awareness</a></h3>
|
||||
<div class="paragraph">
|
||||
<p>Eureka can be made even more resilient and available by running multiple instances and asking them to register with each other.
|
||||
In fact, this is the default behavior, so all you need to do to make it work is add a valid <code>serviceUrl</code> to a peer, as shown in the following example:</p>
|
||||
</div>
|
||||
<div class="listingblock">
|
||||
<div class="title">application.yml (Two Peer Aware Eureka Servers)</div>
|
||||
<div class="content">
|
||||
<pre>---
|
||||
spring:
|
||||
profiles: peer1
|
||||
eureka:
|
||||
instance:
|
||||
hostname: peer1
|
||||
client:
|
||||
serviceUrl:
|
||||
defaultZone: https://peer2/eureka/
|
||||
|
||||
---
|
||||
spring:
|
||||
profiles: peer2
|
||||
eureka:
|
||||
instance:
|
||||
hostname: peer2
|
||||
client:
|
||||
serviceUrl:
|
||||
defaultZone: https://peer1/eureka/</pre>
|
||||
</div>
|
||||
</div>
|
||||
<div class="paragraph">
|
||||
<p>In the preceding example, we have a YAML file that can be used to run the same server on two hosts (<code>peer1</code> and <code>peer2</code>) by running it in different Spring profiles.
|
||||
You could use this configuration to test the peer awareness on a single host (there is not much value in doing that in production) by manipulating <code>/etc/hosts</code> to resolve the host names.
|
||||
In fact, the <code>eureka.instance.hostname</code> is not needed if you are running on a machine that knows its own hostname (by default, it is looked up by using <code>java.net.InetAddress</code>).</p>
|
||||
</div>
|
||||
<div class="paragraph">
|
||||
<p>You can add multiple peers to a system, and, as long as they are all connected to each other by at least one edge, they synchronize
|
||||
the registrations amongst themselves.
|
||||
If the peers are physically separated (inside a data center or between multiple data centers), then the system can, in principle, survive “split-brain” type failures.
|
||||
You can add multiple peers to a system, and as long as they are all
|
||||
directly connected to each other, they will synchronize
|
||||
the registrations amongst themselves.</p>
|
||||
</div>
|
||||
<div class="listingblock">
|
||||
<div class="title">application.yml (Three Peer Aware Eureka Servers)</div>
|
||||
<div class="content">
|
||||
<pre>eureka:
|
||||
client:
|
||||
serviceUrl:
|
||||
defaultZone: https://peer1/eureka/,http://peer2/eureka/,http://peer3/eureka/
|
||||
|
||||
---
|
||||
spring:
|
||||
profiles: peer1
|
||||
eureka:
|
||||
instance:
|
||||
hostname: peer1
|
||||
|
||||
---
|
||||
spring:
|
||||
profiles: peer2
|
||||
eureka:
|
||||
instance:
|
||||
hostname: peer2
|
||||
|
||||
---
|
||||
spring:
|
||||
profiles: peer3
|
||||
eureka:
|
||||
instance:
|
||||
hostname: peer3</pre>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="sect2">
|
||||
<h3 id="spring-cloud-eureka-server-prefer-ip-address"><a class="anchor" href="#spring-cloud-eureka-server-prefer-ip-address"></a><a class="link" href="#spring-cloud-eureka-server-prefer-ip-address">2.6. When to Prefer IP Address</a></h3>
|
||||
<div class="paragraph">
|
||||
<p>In some cases, it is preferable for Eureka to advertise the IP addresses of services rather than the hostname.
|
||||
Set <code>eureka.instance.preferIpAddress</code> to <code>true</code> and, when the application registers with eureka, it uses its IP address rather than its hostname.</p>
|
||||
</div>
|
||||
<div class="admonitionblock tip">
|
||||
<table>
|
||||
<tr>
|
||||
<td class="icon">
|
||||
<i class="fa icon-tip" title="Tip"></i>
|
||||
</td>
|
||||
<td class="content">
|
||||
<div class="paragraph">
|
||||
<p>If the hostname cannot be determined by Java, then the IP address is sent to Eureka.
|
||||
Only explict way of setting the hostname is by setting <code>eureka.instance.hostname</code> property.
|
||||
You can set your hostname at the run-time by using an environment variable — for example, <code>eureka.instance.hostname=${HOST_NAME}</code>.</p>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
<div class="sect2">
|
||||
<h3 id="securing-the-eureka-server"><a class="anchor" href="#securing-the-eureka-server"></a><a class="link" href="#securing-the-eureka-server">2.7. Securing The Eureka Server</a></h3>
|
||||
<div class="paragraph">
|
||||
<p>You can secure your Eureka server simply by adding Spring Security to your
|
||||
server’s classpath via <code>spring-boot-starter-security</code>. By default when Spring Security is on the classpath it will require that
|
||||
a valid CSRF token be sent with every request to the app. Eureka clients will not generally possess a valid
|
||||
cross site request forgery (CSRF) token you will need to disable this requirement for the <code>/eureka/**</code> endpoints.
|
||||
For example:</p>
|
||||
</div>
|
||||
<div class="listingblock">
|
||||
<div class="content">
|
||||
<pre class="highlightjs highlight"><code class="language-java hljs" data-lang="java">@EnableWebSecurity
|
||||
class WebSecurityConfig extends WebSecurityConfigurerAdapter {
|
||||
|
||||
@Override
|
||||
protected void configure(HttpSecurity http) throws Exception {
|
||||
http.csrf().ignoringAntMatchers("/eureka/**");
|
||||
super.configure(http);
|
||||
}
|
||||
}</code></pre>
|
||||
</div>
|
||||
</div>
|
||||
<div class="paragraph">
|
||||
<p>For more information on CSRF see the <a href="https://docs.spring.io/spring-security/site/docs/current/reference/htmlsingle/#csrf">Spring Security documentation</a>.</p>
|
||||
</div>
|
||||
<div class="paragraph">
|
||||
<p>A demo Eureka Server can be found in the Spring Cloud Samples <a href="https://github.com/spring-cloud-samples/eureka/tree/Eureka-With-Security">repo</a>.</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="sect2">
|
||||
<h3 id="jdk-11-support"><a class="anchor" href="#jdk-11-support"></a><a class="link" href="#jdk-11-support">2.8. JDK 11 Support</a></h3>
|
||||
<div class="paragraph">
|
||||
<p>The JAXB modules which the Eureka server depends upon were removed in JDK 11. If you intend to use JDK 11
|
||||
when running a Eureka server you must include these dependencies in your POM or Gradle file.</p>
|
||||
</div>
|
||||
<div class="listingblock">
|
||||
<div class="content">
|
||||
<pre class="highlightjs highlight"><code class="language-xml hljs" data-lang="xml"><dependency>
|
||||
<groupId>org.glassfish.jaxb</groupId>
|
||||
<artifactId>jaxb-runtime</artifactId>
|
||||
</dependency></code></pre>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="sect1">
|
||||
<h2 id="configuration-properties"><a class="anchor" href="#configuration-properties"></a><a class="link" href="#configuration-properties">3. Configuration properties</a></h2>
|
||||
<div class="sectionbody">
|
||||
<div class="paragraph">
|
||||
<p>To see the list of all Spring Cloud Netflix related configuration properties please check <a href="appendix.html">the Appendix page</a>.</p>
|
||||
</div>
|
||||
</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/github.min.css">
|
||||
<script src="js/highlight/highlight.min.js"></script>
|
||||
<script>hljs.initHighlighting()</script>
|
||||
</body>
|
||||
</html>
|
||||
BIN
spring-cloud-netflix/3.0.0-M2/reference/htmlsingle/favicon.ico
Normal file
|
After Width: | Height: | Size: 109 KiB |
|
After Width: | Height: | Size: 225 KiB |
|
After Width: | Height: | Size: 44 KiB |
|
After Width: | Height: | Size: 39 KiB |
|
After Width: | Height: | Size: 14 KiB |
2
spring-cloud-netflix/3.0.0-M2/reference/htmlsingle/js/highlight/highlight.min.js
vendored
Normal file
96
spring-cloud-netflix/3.0.0-M2/reference/htmlsingle/js/highlight/styles/atom-one-light.min.css
vendored
Normal file
@@ -0,0 +1,96 @@
|
||||
/*
|
||||
|
||||
Atom One Light by Daniel Gamage
|
||||
Original One Light Syntax theme from https://github.com/atom/one-light-syntax
|
||||
|
||||
base: #fafafa
|
||||
mono-1: #383a42
|
||||
mono-2: #686b77
|
||||
mono-3: #a0a1a7
|
||||
hue-1: #0184bb
|
||||
hue-2: #4078f2
|
||||
hue-3: #a626a4
|
||||
hue-4: #50a14f
|
||||
hue-5: #e45649
|
||||
hue-5-2: #c91243
|
||||
hue-6: #986801
|
||||
hue-6-2: #c18401
|
||||
|
||||
*/
|
||||
|
||||
.hljs {
|
||||
display: block;
|
||||
overflow-x: auto;
|
||||
padding: 0.5em;
|
||||
color: #383a42;
|
||||
background: #fafafa;
|
||||
}
|
||||
|
||||
.hljs-comment,
|
||||
.hljs-quote {
|
||||
color: #a0a1a7;
|
||||
font-style: italic;
|
||||
}
|
||||
|
||||
.hljs-doctag,
|
||||
.hljs-keyword,
|
||||
.hljs-formula {
|
||||
color: #a626a4;
|
||||
}
|
||||
|
||||
.hljs-section,
|
||||
.hljs-name,
|
||||
.hljs-selector-tag,
|
||||
.hljs-deletion,
|
||||
.hljs-subst {
|
||||
color: #e45649;
|
||||
}
|
||||
|
||||
.hljs-literal {
|
||||
color: #0184bb;
|
||||
}
|
||||
|
||||
.hljs-string,
|
||||
.hljs-regexp,
|
||||
.hljs-addition,
|
||||
.hljs-attribute,
|
||||
.hljs-meta-string {
|
||||
color: #50a14f;
|
||||
}
|
||||
|
||||
.hljs-built_in,
|
||||
.hljs-class .hljs-title {
|
||||
color: #c18401;
|
||||
}
|
||||
|
||||
.hljs-attr,
|
||||
.hljs-variable,
|
||||
.hljs-template-variable,
|
||||
.hljs-type,
|
||||
.hljs-selector-class,
|
||||
.hljs-selector-attr,
|
||||
.hljs-selector-pseudo,
|
||||
.hljs-number {
|
||||
color: #986801;
|
||||
}
|
||||
|
||||
.hljs-symbol,
|
||||
.hljs-bullet,
|
||||
.hljs-link,
|
||||
.hljs-meta,
|
||||
.hljs-selector-id,
|
||||
.hljs-title {
|
||||
color: #4078f2;
|
||||
}
|
||||
|
||||
.hljs-emphasis {
|
||||
font-style: italic;
|
||||
}
|
||||
|
||||
.hljs-strong {
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.hljs-link {
|
||||
text-decoration: underline;
|
||||
}
|
||||
@@ -0,0 +1,79 @@
|
||||
/**
|
||||
* GitHub Gist Theme
|
||||
* Author : Anthony Attard - https://github.com/AnthonyAttard
|
||||
* Author : Louis Barranqueiro - https://github.com/LouisBarranqueiro
|
||||
*/
|
||||
|
||||
.hljs {
|
||||
display: block;
|
||||
background: white;
|
||||
padding: 0.5em;
|
||||
color: #333333;
|
||||
overflow-x: auto;
|
||||
}
|
||||
|
||||
.hljs-comment,
|
||||
.hljs-meta {
|
||||
color: #969896;
|
||||
}
|
||||
|
||||
.hljs-variable,
|
||||
.hljs-template-variable,
|
||||
.hljs-strong,
|
||||
.hljs-emphasis,
|
||||
.hljs-quote {
|
||||
color: #df5000;
|
||||
}
|
||||
|
||||
.hljs-keyword,
|
||||
.hljs-selector-tag,
|
||||
.hljs-type {
|
||||
color: #d73a49;
|
||||
}
|
||||
|
||||
.hljs-literal,
|
||||
.hljs-symbol,
|
||||
.hljs-bullet,
|
||||
.hljs-attribute {
|
||||
color: #0086b3;
|
||||
}
|
||||
|
||||
.hljs-section,
|
||||
.hljs-name {
|
||||
color: #63a35c;
|
||||
}
|
||||
|
||||
.hljs-tag {
|
||||
color: #333333;
|
||||
}
|
||||
|
||||
.hljs-title,
|
||||
.hljs-attr,
|
||||
.hljs-selector-id,
|
||||
.hljs-selector-class,
|
||||
.hljs-selector-attr,
|
||||
.hljs-selector-pseudo {
|
||||
color: #6f42c1;
|
||||
}
|
||||
|
||||
.hljs-addition {
|
||||
color: #55a532;
|
||||
background-color: #eaffea;
|
||||
}
|
||||
|
||||
.hljs-deletion {
|
||||
color: #bd2c00;
|
||||
background-color: #ffecec;
|
||||
}
|
||||
|
||||
.hljs-link {
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
.hljs-number {
|
||||
color: #005cc5;
|
||||
}
|
||||
|
||||
.hljs-string {
|
||||
color: #032f62;
|
||||
}
|
||||
99
spring-cloud-netflix/3.0.0-M2/reference/htmlsingle/js/highlight/styles/github.min.css
vendored
Normal file
@@ -0,0 +1,99 @@
|
||||
/*
|
||||
|
||||
github.com style (c) Vasily Polovnyov <vast@whiteants.net>
|
||||
|
||||
*/
|
||||
|
||||
.hljs {
|
||||
display: block;
|
||||
overflow-x: auto;
|
||||
padding: 0.5em;
|
||||
color: #333;
|
||||
background: #f8f8f8;
|
||||
}
|
||||
|
||||
.hljs-comment,
|
||||
.hljs-quote {
|
||||
color: #998;
|
||||
font-style: italic;
|
||||
}
|
||||
|
||||
.hljs-keyword,
|
||||
.hljs-selector-tag,
|
||||
.hljs-subst {
|
||||
color: #333;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.hljs-number,
|
||||
.hljs-literal,
|
||||
.hljs-variable,
|
||||
.hljs-template-variable,
|
||||
.hljs-tag .hljs-attr {
|
||||
color: #008080;
|
||||
}
|
||||
|
||||
.hljs-string,
|
||||
.hljs-doctag {
|
||||
color: #d14;
|
||||
}
|
||||
|
||||
.hljs-title,
|
||||
.hljs-section,
|
||||
.hljs-selector-id {
|
||||
color: #900;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.hljs-subst {
|
||||
font-weight: normal;
|
||||
}
|
||||
|
||||
.hljs-type,
|
||||
.hljs-class .hljs-title {
|
||||
color: #458;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.hljs-tag,
|
||||
.hljs-name,
|
||||
.hljs-attribute {
|
||||
color: #000080;
|
||||
font-weight: normal;
|
||||
}
|
||||
|
||||
.hljs-regexp,
|
||||
.hljs-link {
|
||||
color: #009926;
|
||||
}
|
||||
|
||||
.hljs-symbol,
|
||||
.hljs-bullet {
|
||||
color: #990073;
|
||||
}
|
||||
|
||||
.hljs-built_in,
|
||||
.hljs-builtin-name {
|
||||
color: #0086b3;
|
||||
}
|
||||
|
||||
.hljs-meta {
|
||||
color: #999;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.hljs-deletion {
|
||||
background: #fdd;
|
||||
}
|
||||
|
||||
.hljs-addition {
|
||||
background: #dfd;
|
||||
}
|
||||
|
||||
.hljs-emphasis {
|
||||
font-style: italic;
|
||||
}
|
||||
|
||||
.hljs-strong {
|
||||
font-weight: bold;
|
||||
}
|
||||
@@ -0,0 +1,89 @@
|
||||
/*
|
||||
|
||||
Google Code style (c) Aahan Krish <geekpanth3r@gmail.com>
|
||||
|
||||
*/
|
||||
|
||||
.hljs {
|
||||
display: block;
|
||||
overflow-x: auto;
|
||||
padding: 0.5em;
|
||||
background: white;
|
||||
color: black;
|
||||
}
|
||||
|
||||
.hljs-comment,
|
||||
.hljs-quote {
|
||||
color: #800;
|
||||
}
|
||||
|
||||
.hljs-keyword,
|
||||
.hljs-selector-tag,
|
||||
.hljs-section,
|
||||
.hljs-title,
|
||||
.hljs-name {
|
||||
color: #008;
|
||||
}
|
||||
|
||||
.hljs-variable,
|
||||
.hljs-template-variable {
|
||||
color: #660;
|
||||
}
|
||||
|
||||
.hljs-string,
|
||||
.hljs-selector-attr,
|
||||
.hljs-selector-pseudo,
|
||||
.hljs-regexp {
|
||||
color: #080;
|
||||
}
|
||||
|
||||
.hljs-literal,
|
||||
.hljs-symbol,
|
||||
.hljs-bullet,
|
||||
.hljs-meta,
|
||||
.hljs-number,
|
||||
.hljs-link {
|
||||
color: #066;
|
||||
}
|
||||
|
||||
.hljs-title,
|
||||
.hljs-doctag,
|
||||
.hljs-type,
|
||||
.hljs-attr,
|
||||
.hljs-built_in,
|
||||
.hljs-builtin-name,
|
||||
.hljs-params {
|
||||
color: #606;
|
||||
}
|
||||
|
||||
.hljs-attribute,
|
||||
.hljs-subst {
|
||||
color: #000;
|
||||
}
|
||||
|
||||
.hljs-formula {
|
||||
background-color: #eee;
|
||||
font-style: italic;
|
||||
}
|
||||
|
||||
.hljs-selector-id,
|
||||
.hljs-selector-class {
|
||||
color: #9B703F
|
||||
}
|
||||
|
||||
.hljs-addition {
|
||||
background-color: #baeeba;
|
||||
}
|
||||
|
||||
.hljs-deletion {
|
||||
background-color: #ffc8bd;
|
||||
}
|
||||
|
||||
.hljs-doctag,
|
||||
.hljs-strong {
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.hljs-emphasis {
|
||||
font-style: italic;
|
||||
}
|
||||
84
spring-cloud-netflix/3.0.0-M2/reference/htmlsingle/js/highlight/styles/solarized-light.min.css
vendored
Normal file
@@ -0,0 +1,84 @@
|
||||
/*
|
||||
|
||||
Orginal Style from ethanschoonover.com/solarized (c) Jeremy Hull <sourdrums@gmail.com>
|
||||
|
||||
*/
|
||||
|
||||
.hljs {
|
||||
display: block;
|
||||
overflow-x: auto;
|
||||
padding: 0.5em;
|
||||
background: #fdf6e3;
|
||||
color: #657b83;
|
||||
}
|
||||
|
||||
.hljs-comment,
|
||||
.hljs-quote {
|
||||
color: #93a1a1;
|
||||
}
|
||||
|
||||
/* Solarized Green */
|
||||
.hljs-keyword,
|
||||
.hljs-selector-tag,
|
||||
.hljs-addition {
|
||||
color: #859900;
|
||||
}
|
||||
|
||||
/* Solarized Cyan */
|
||||
.hljs-number,
|
||||
.hljs-string,
|
||||
.hljs-meta .hljs-meta-string,
|
||||
.hljs-literal,
|
||||
.hljs-doctag,
|
||||
.hljs-regexp {
|
||||
color: #2aa198;
|
||||
}
|
||||
|
||||
/* Solarized Blue */
|
||||
.hljs-title,
|
||||
.hljs-section,
|
||||
.hljs-name,
|
||||
.hljs-selector-id,
|
||||
.hljs-selector-class {
|
||||
color: #268bd2;
|
||||
}
|
||||
|
||||
/* Solarized Yellow */
|
||||
.hljs-attribute,
|
||||
.hljs-attr,
|
||||
.hljs-variable,
|
||||
.hljs-template-variable,
|
||||
.hljs-class .hljs-title,
|
||||
.hljs-type {
|
||||
color: #b58900;
|
||||
}
|
||||
|
||||
/* Solarized Orange */
|
||||
.hljs-symbol,
|
||||
.hljs-bullet,
|
||||
.hljs-subst,
|
||||
.hljs-meta,
|
||||
.hljs-meta .hljs-keyword,
|
||||
.hljs-selector-attr,
|
||||
.hljs-selector-pseudo,
|
||||
.hljs-link {
|
||||
color: #cb4b16;
|
||||
}
|
||||
|
||||
/* Solarized Red */
|
||||
.hljs-built_in,
|
||||
.hljs-deletion {
|
||||
color: #dc322f;
|
||||
}
|
||||
|
||||
.hljs-formula {
|
||||
background: #eee8d5;
|
||||
}
|
||||
|
||||
.hljs-emphasis {
|
||||
font-style: italic;
|
||||
}
|
||||
|
||||
.hljs-strong {
|
||||
font-weight: bold;
|
||||
}
|
||||
80
spring-cloud-netflix/3.0.0-M2/reference/htmlsingle/js/toc.js
Normal file
@@ -0,0 +1,80 @@
|
||||
var toctitle = document.getElementById('toctitle');
|
||||
var path = window.location.pathname;
|
||||
if (toctitle != null) {
|
||||
var oldtoc = toctitle.nextElementSibling;
|
||||
var newtoc = document.createElement('div');
|
||||
newtoc.setAttribute('id', 'tocbot');
|
||||
newtoc.setAttribute('class', 'js-toc desktop-toc');
|
||||
oldtoc.setAttribute('class', 'mobile-toc');
|
||||
oldtoc.parentNode.appendChild(newtoc);
|
||||
tocbot.init({
|
||||
contentSelector: '#content',
|
||||
headingSelector: 'h1, h2, h3, h4, h5',
|
||||
positionFixedSelector: 'body',
|
||||
fixedSidebarOffset: 90,
|
||||
smoothScroll: false
|
||||
});
|
||||
if (!path.endsWith("index.html") && !path.endsWith("/")) {
|
||||
var link = document.createElement("a");
|
||||
if (document.getElementById('index-link')) {
|
||||
indexLinkElement = document.querySelector('#index-link > p > a');
|
||||
linkHref = indexLinkElement.getAttribute("href");
|
||||
link.setAttribute("href", linkHref);
|
||||
} else {
|
||||
link.setAttribute("href", "index.html");
|
||||
}
|
||||
link.innerHTML = "<span><i class=\"fa fa-chevron-left\" aria-hidden=\"true\"></i></span> Back to index";
|
||||
var block = document.createElement("div");
|
||||
block.setAttribute('class', 'back-action');
|
||||
block.appendChild(link);
|
||||
var toc = document.getElementById('toc');
|
||||
var next = document.getElementById('toctitle').nextElementSibling;
|
||||
toc.insertBefore(block, next);
|
||||
}
|
||||
}
|
||||
|
||||
var headerHtml = '<div id="header-spring">\n' +
|
||||
'<h1>\n' +
|
||||
'<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0" y="0"\n' +
|
||||
'viewBox="0 0 245.8 45.3" style="enable-background:new 0 0 245.8 45.3;" xml:space="preserve">\n' +
|
||||
'<g id="logos">\n' +
|
||||
'<g>\n' +
|
||||
'<path class="st0" d="M39.4,3.7c-0.6,1.5-1.4,2.8-2.3,4c-3.9-4-9.3-6.4-15.2-6.4c-11.7,0-21.3,9.5-21.3,21.3\n' +
|
||||
'c0,6.2,2.6,11.7,6.8,15.6l0.8,0.7c3.7,3.1,8.5,5,13.7,5c11.2,0,20.4-8.7,21.2-19.8C43.7,18.7,42.1,11.8,39.4,3.7z M10.5,38.3\n' +
|
||||
'c-0.6,0.8-1.8,0.9-2.6,0.3C7.1,37.9,7,36.8,7.6,36c0.6-0.8,1.8-0.9,2.6-0.3C11,36.4,11.1,37.5,10.5,38.3z M39.3,31.9\n' +
|
||||
'c-5.2,7-16.5,4.6-23.6,5c0,0-1.3,0.1-2.6,0.3c0,0,0.5-0.2,1.1-0.4c5-1.7,7.4-2.1,10.5-3.7c5.8-3,11.5-9.4,12.7-16.1\n' +
|
||||
'c-2.2,6.4-8.9,12-14.9,14.2c-4.2,1.5-11.7,3-11.7,3c0,0-0.3-0.2-0.3-0.2c-5.1-2.5-5.3-13.6,4-17.1c4.1-1.6,8-0.7,12.4-1.8\n' +
|
||||
'C31.6,14.1,37,10.6,39.2,6C41.7,13.3,44.7,24.8,39.3,31.9z"/>\n' +
|
||||
'<g>\n' +
|
||||
'<path class="st0" d="M55.2,30.9c-0.5-0.3-0.9-0.9-0.9-1.6c0-1.1,0.8-1.9,1.9-1.9c0.4,0,0.7,0.1,1,0.3c2,1.3,4.1,2,5.9,2\n' +
|
||||
'c2,0,3.2-0.9,3.2-2.2v-0.1c0-1.6-2.2-2.2-4.6-2.9c-3-0.9-6.5-2.1-6.5-6.1v-0.1c0-3.9,3.2-6.3,7.4-6.3c2.2,0,4.5,0.6,6.5,1.7\n' +
|
||||
'c0.7,0.4,1.1,1,1.1,1.8c0,1.1-0.9,1.9-2,1.9c-0.4,0-0.6-0.1-0.9-0.2c-1.7-0.9-3.4-1.4-4.9-1.4c-1.8,0-2.9,0.9-2.9,2v0.1\n' +
|
||||
'c0,1.5,2.2,2.2,4.7,2.9c3,0.9,6.4,2.3,6.4,6v0.1c0,4.3-3.4,6.5-7.7,6.5C60.4,33.3,57.6,32.5,55.2,30.9z"/>\n' +
|
||||
'<path class="st0" d="M72.5,14.3c0-1.3,1-2.4,2.3-2.4c1.3,0,2.4,1.1,2.4,2.4v1.4c1.5-2.2,3.7-3.9,7-3.9c4.8,0,9.6,3.8,9.6,10.7\n' +
|
||||
'v0.1c0,6.8-4.7,10.7-9.6,10.7c-3.4,0-5.6-1.7-7-3.6V37c0,1.3-1.1,2.4-2.4,2.4c-1.3,0-2.3-1-2.3-2.4V14.3z M89.1,22.7L89.1,22.7\n' +
|
||||
'c0-4.1-2.7-6.7-5.9-6.7c-3.2,0-6,2.7-6,6.6v0.1c0,4,2.8,6.6,6,6.6C86.4,29.3,89.1,26.7,89.1,22.7z"/>\n' +
|
||||
'<path class="st0" d="M95.7,14.3c0-1.3,1-2.4,2.3-2.4c1.3,0,2.4,1.1,2.4,2.4v1.1c0.2-1.8,3.1-3.5,5.2-3.5c1.5,0,2.3,1,2.3,2.3\n' +
|
||||
'c0,1.3-0.8,2.1-1.9,2.3c-3.4,0.6-5.7,3.5-5.7,7.6V31c0,1.3-1.1,2.3-2.4,2.3c-1.3,0-2.3-1-2.3-2.3V14.3z"/>\n' +
|
||||
'<path class="st0" d="M109.7,14.3c0-1.3,1-2.4,2.3-2.4c1.3,0,2.4,1.1,2.4,2.4V31c0,1.3-1.1,2.3-2.4,2.3c-1.3,0-2.3-1-2.3-2.3V14.3\n' +
|
||||
'z"/>\n' +
|
||||
'<path class="st0" d="M116.9,14.3c0-1.3,1-2.4,2.3-2.4c1.3,0,2.4,1.1,2.4,2.4v1c1.3-1.9,3.2-3.4,6.5-3.4c4.7,0,7.4,3.1,7.4,7.9V31\n' +
|
||||
'c0,1.3-1,2.3-2.3,2.3c-1.3,0-2.4-1-2.4-2.3v-9.7c0-3.2-1.6-5-4.4-5c-2.7,0-4.7,1.9-4.7,5.1V31c0,1.3-1.1,2.3-2.4,2.3\n' +
|
||||
'c-1.3,0-2.3-1-2.3-2.3V14.3z"/>\n' +
|
||||
'<path class="st0" d="M156.2,11.9c-1.3,0-2.4,1.1-2.4,2.4v1.4c-1.5-2.2-3.7-3.9-7-3.9c-4.9,0-9.6,3.8-9.6,10.7v0.1\n' +
|
||||
'c0,6.8,4.7,10.7,9.6,10.7c3.4,0,5.6-1.7,7-3.6c-0.2,3.7-2.5,5.7-6.5,5.7c-2.4,0-4.5-0.6-6.3-1.6c-0.2-0.1-0.5-0.2-0.9-0.2\n' +
|
||||
'c-1.1,0-2,0.9-2,2c0,0.9,0.5,1.6,1.3,1.9c2.5,1.2,5.1,1.8,8,1.8c3.7,0,6.6-0.9,8.5-2.8c1.7-1.7,2.7-4.3,2.7-7.8V14.3\n' +
|
||||
'C158.5,13,157.5,11.9,156.2,11.9z M147.9,29.2c-3.2,0-5.9-2.5-5.9-6.6v-0.1c0-4,2.7-6.6,5.9-6.6c3.2,0,6,2.7,6,6.6v0.1\n' +
|
||||
'C153.9,26.6,151.1,29.2,147.9,29.2z"/>\n' +
|
||||
'<path class="st0" d="M114.5,6.3c0,1.3-1.1,2.4-2.4,2.4c-1.3,0-2.4-1.1-2.4-2.4c0-1.3,1.1-2.4,2.4-2.4\n' +
|
||||
'C113.4,3.9,114.5,4.9,114.5,6.3z"/>\n' +
|
||||
'</g>\n' +
|
||||
'</g>\n' +
|
||||
'</g>\n' +
|
||||
'</svg>\n' +
|
||||
'\n' +
|
||||
'</h1>\n' +
|
||||
'</div>';
|
||||
|
||||
var header = document.createElement("div");
|
||||
header.innerHTML = headerHtml;
|
||||
document.body.insertBefore(header, document.body.firstChild);
|
||||
@@ -0,0 +1 @@
|
||||
.toc{overflow-y:auto}.toc>.toc-list{overflow:hidden;position:relative}.toc>.toc-list li{list-style:none}.toc-list{margin:0;padding-left:10px}a.toc-link{color:currentColor;height:100%}.is-collapsible{max-height:1000px;overflow:hidden;transition:all 300ms ease-in-out}.is-collapsed{max-height:0}.is-position-fixed{position:fixed !important;top:0}.is-active-link{font-weight:700}.toc-link::before{background-color:#EEE;content:' ';display:inline-block;height:inherit;left:0;margin-top:-1px;position:absolute;width:2px}.is-active-link::before{background-color:#54BC4B}
|
||||