diff --git a/1.0.x/index.html b/1.0.x/index.html index 523165f2..e69a3170 100644 --- a/1.0.x/index.html +++ b/1.0.x/index.html @@ -8,7 +8,7 @@ Spring Cloud Consul - + + + + Click here if you are not redirected. + diff --git a/js/backbone.js b/js/backbone.js index 3512d42f..7197d646 100644 --- a/js/backbone.js +++ b/js/backbone.js @@ -3,7 +3,7 @@ // (c) 2010-2013 Jeremy Ashkenas, DocumentCloud Inc. // Backbone may be freely distributed under the MIT license. // For all details and documentation: -// http://backbonejs.org +// https://backbonejs.org (function(){ @@ -1298,7 +1298,7 @@ // ---------------- // Handles cross-browser history management, based on either - // [pushState](http://diveintohtml5.info/history.html) and real URLs, or + // [pushState](https://diveintohtml5.info/history.html) and real URLs, or // [onhashchange](https://developer.mozilla.org/en-US/docs/DOM/window.onhashchange) // and URL fragments. If the browser supports neither (old IE, natch), // falls back to polling. diff --git a/js/highlight/styles/dracula.min.css b/js/highlight/styles/dracula.min.css index d591db68..578f0b40 100644 --- a/js/highlight/styles/dracula.min.css +++ b/js/highlight/styles/dracula.min.css @@ -7,7 +7,7 @@ https://github.com/zenorocha/dracula-theme Copyright 2015, All rights reserved Code licensed under the MIT license -http://zenorocha.mit-license.org +https://zenorocha.mit-license.org/ @author Éverton Ribeiro @author Zeno Rocha diff --git a/js/highlight/styles/monokai-sublime.min.css b/js/highlight/styles/monokai-sublime.min.css index 2864170d..ed52c92e 100644 --- a/js/highlight/styles/monokai-sublime.min.css +++ b/js/highlight/styles/monokai-sublime.min.css @@ -1,6 +1,6 @@ /* -Monokai Sublime style. Derived from Monokai by noformnocontent http://nn.mit-license.org/ +Monokai Sublime style. Derived from Monokai by noformnocontent https://nn.mit-license.org/ */ diff --git a/js/highlight/styles/monokai.min.css b/js/highlight/styles/monokai.min.css index 775d53f9..a5735585 100644 --- a/js/highlight/styles/monokai.min.css +++ b/js/highlight/styles/monokai.min.css @@ -1,5 +1,5 @@ /* -Monokai style - ported by Luigi Maselli - http://grigio.org +Monokai style - ported by Luigi Maselli - https://grigio.org */ .hljs { diff --git a/js/jquery.js b/js/jquery.js index 6f8c9675..89181508 100644 --- a/js/jquery.js +++ b/js/jquery.js @@ -1,13 +1,13 @@ /*! * jQuery JavaScript Library v1.10.1 - * http://jquery.com/ + * https://jquery.com/ * * Includes Sizzle.js - * http://sizzlejs.com/ + * https://sizzlejs.com/ * * Copyright 2005, 2013 jQuery Foundation, Inc. and other contributors * Released under the MIT license - * http://jquery.org/license + * https://jquery.org/license * * Date: 2013-05-30T21:49Z */ @@ -561,7 +561,7 @@ jQuery.extend({ if ( data ) { // Make sure the incoming data is actual JSON - // Logic borrowed from http://json.org/json2.js + // Logic borrowed from https://json.org/json2.js if ( rvalidchars.test( data.replace( rvalidescape, "@" ) .replace( rvalidtokens, "]" ) .replace( rvalidbraces, "")) ) { @@ -602,7 +602,7 @@ jQuery.extend({ // Evaluates a script in a global context // Workarounds based on findings by Jim Driscoll - // http://weblogs.java.net/blog/driscoll/archive/2009/09/08/eval-javascript-global-context + // https://weblogs.java.net/blog/driscoll/archive/2009/09/08/eval-javascript-global-context globalEval: function( data ) { if ( data && jQuery.trim( data ) ) { // We use execScript on Internet Explorer @@ -921,7 +921,7 @@ jQuery.ready.promise = function( obj ) { // Catch cases where $(document).ready() is called after the browser event has already occurred. // we once tried to use readyState "interactive" here, but it caused issues like the one - // discovered by ChrisS here: http://bugs.jquery.com/ticket/12282#comment:15 + // discovered by ChrisS here: https://bugs.jquery.com/ticket/12282#comment:15 if ( document.readyState === "complete" ) { // Handle it asynchronously to allow scripts the opportunity to delay ready setTimeout( jQuery.ready ); @@ -1001,11 +1001,11 @@ function isArraylike( obj ) { rootjQuery = jQuery(document); /*! * Sizzle CSS Selector Engine v1.9.4-pre - * http://sizzlejs.com/ + * https://sizzlejs.com/ * * Copyright 2013 jQuery Foundation, Inc. and other contributors * Released under the MIT license - * http://jquery.org/license + * https://jquery.org/license * * Date: 2013-05-27 */ @@ -1069,17 +1069,17 @@ var i, // Regular expressions - // Whitespace characters http://www.w3.org/TR/css3-selectors/#whitespace + // Whitespace characters https://www.w3.org/TR/css3-selectors/#whitespace whitespace = "[\\x20\\t\\r\\n\\f]", - // http://www.w3.org/TR/css3-syntax/#characters + // https://www.w3.org/TR/css3-syntax/#characters characterEncoding = "(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+", // Loosely modeled on CSS identifier characters - // An unquoted value should be a CSS identifier http://www.w3.org/TR/css3-selectors/#attribute-selectors - // Proper syntax: http://www.w3.org/TR/CSS21/syndata.html#value-def-identifier + // An unquoted value should be a CSS identifier https://www.w3.org/TR/css3-selectors/#attribute-selectors + // Proper syntax: https://www.w3.org/TR/CSS21/syndata.html#value-def-identifier identifier = characterEncoding.replace( "w", "w#" ), - // Acceptable operators http://www.w3.org/TR/selectors/#attribute-selectors + // Acceptable operators https://www.w3.org/TR/selectors/#attribute-selectors attributes = "\\[" + whitespace + "*(" + characterEncoding + ")" + whitespace + "*(?:([*^$|!~]?=)" + whitespace + "*(?:(['\"])((?:\\\\.|[^\\\\])*?)\\3|(" + identifier + ")|)|)" + whitespace + "*\\]", @@ -1129,7 +1129,7 @@ var i, rescape = /'|\\/g, - // CSS escapes http://www.w3.org/TR/CSS21/syndata.html#escaped-characters + // CSS escapes https://www.w3.org/TR/CSS21/syndata.html#escaped-characters runescape = new RegExp( "\\\\([\\da-f]{1,6}" + whitespace + "?|(" + whitespace + ")|.)", "ig" ), funescape = function( _, escaped, escapedWhitespace ) { var high = "0x" + escaped - 0x10000; @@ -1376,7 +1376,7 @@ function boolHandler( elem, name ) { /** * Fetches attributes without interpolation - * http://msdn.microsoft.com/en-us/library/ms536429%28VS.85%29.aspx + * https://msdn.microsoft.com/en-us/library/ms536429%28VS.85%29.aspx * @param {Element} elem * @param {String} name */ @@ -1653,7 +1653,7 @@ setDocument = Sizzle.setDocument = function( node ) { // We allow this because of a bug in IE8/9 that throws an error // whenever `document.activeElement` is accessed on an iframe // So, we allow :focus to pass through QSA all the time to avoid the IE error - // See http://bugs.jquery.com/ticket/13378 + // See https://bugs.jquery.com/ticket/13378 rbuggyQSA = []; if ( (support.qsa = isNative(doc.querySelectorAll)) ) { @@ -1664,7 +1664,7 @@ setDocument = Sizzle.setDocument = function( node ) { // This is to test IE's treatment of not explicitly // setting a boolean content attribute, // since its presence should be enough - // http://bugs.jquery.com/ticket/12359 + // https://bugs.jquery.com/ticket/12359 div.innerHTML = ""; // Support: IE8 @@ -1674,7 +1674,7 @@ setDocument = Sizzle.setDocument = function( node ) { } // Webkit/Opera - :checked should return selected option elements - // http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked + // https://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked // IE8 throws error here and will not see later tests if ( !div.querySelectorAll(":checked").length ) { rbuggyQSA.push(":checked"); @@ -2219,7 +2219,7 @@ Expr = Sizzle.selectors = { "PSEUDO": function( pseudo, argument ) { // pseudo-class names are case-insensitive - // http://www.w3.org/TR/selectors/#pseudo-classes + // https://www.w3.org/TR/selectors/#pseudo-classes // Prioritize by case sensitivity in case custom pseudos are added with uppercase letters // Remember that setFilters inherits from pseudos var args, @@ -2303,7 +2303,7 @@ Expr = Sizzle.selectors = { // or beginning with the identifier C immediately followed by "-". // The matching of C against the element's language value is performed case-insensitively. // The identifier C does not have to be a valid language name." - // http://www.w3.org/TR/selectors/#lang-pseudo + // https://www.w3.org/TR/selectors/#lang-pseudo "lang": markFunction( function( lang ) { // lang value must be a valid identifier if ( !ridentifier.test(lang || "") ) { @@ -2350,7 +2350,7 @@ Expr = Sizzle.selectors = { "checked": function( elem ) { // In CSS3, :checked should return both checked and selected elements - // http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked + // https://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked var nodeName = elem.nodeName.toLowerCase(); return (nodeName === "input" && !!elem.checked) || (nodeName === "option" && !!elem.selected); }, @@ -2367,7 +2367,7 @@ Expr = Sizzle.selectors = { // Contents "empty": function( elem ) { - // http://www.w3.org/TR/selectors/#empty-pseudo + // https://www.w3.org/TR/selectors/#empty-pseudo // :empty is only affected by element nodes and content nodes(including text(3), cdata(4)), // not comment, processing instructions, or others // Thanks to Diego Perini for the nodeName shortcut @@ -4024,7 +4024,7 @@ jQuery.fn.extend({ }); }, // Based off of the plugin by Clint Helfers, with permission. - // http://blindsignals.com/index.php/2009/07/jquery-delay/ + // http://blindsignals.com delay: function( time, type ) { time = jQuery.fx ? jQuery.fx.speeds[ time ] || time : time; type = type || "fx"; @@ -4501,7 +4501,7 @@ jQuery.extend({ tabIndex: { get: function( elem ) { // elem.tabIndex doesn't always return the correct value when it hasn't been explicitly set - // http://fluidproject.org/blog/2008/01/09/getting-setting-and-removing-tabindex-values-with-javascript/ + // https://fluidproject.org/blog/2008/01/09/getting-setting-and-removing-tabindex-values-with-javascript/ // Use proper attribute retrieval(#12072) var tabindex = jQuery.find.attr( elem, "tabindex" ); @@ -4641,7 +4641,7 @@ if ( !getSetAttribute ) { // Some attributes require a special call on IE -// http://msdn.microsoft.com/en-us/library/ms536429%28VS.85%29.aspx +// https://msdn.microsoft.com/en-us/library/ms536429%28VS.85%29.aspx if ( !jQuery.support.hrefNormalized ) { // href/src property should get the full normalized URL (#10299/#12915) jQuery.each([ "href", "src" ], function( i, name ) { @@ -5413,7 +5413,7 @@ jQuery.Event = function( src, props ) { }; // jQuery.Event is based on DOM3 Events as specified by the ECMAScript Language Binding -// http://www.w3.org/TR/2003/WD-DOM-Level-3-Events-20030331/ecma-script-binding.html +// https://www.w3.org/TR/2003/WD-DOM-Level-3-Events-20030331/ecma-script-binding.html jQuery.Event.prototype = { isDefaultPrevented: returnFalse, isPropagationStopped: returnFalse, @@ -6516,7 +6516,7 @@ jQuery.extend({ if ( (!jQuery.support.noCloneEvent || !jQuery.support.noCloneChecked) && (elem.nodeType === 1 || elem.nodeType === 11) && !jQuery.isXMLDoc(elem) ) { - // We eschew Sizzle here for performance reasons: http://jsperf.com/getall-vs-sizzle/2 + // We eschew Sizzle here for performance reasons: https://jsperf.com/getall-vs-sizzle/2 destElements = getAll( clone ); srcElements = getAll( elem ); @@ -7120,7 +7120,7 @@ if ( window.getComputedStyle ) { // A tribute to the "awesome hack by Dean Edwards" // Chrome < 17 and Safari 5.0 uses "computed value" instead of "used value" for margin-right // Safari 5.1.7 (at least) returns percentage for a larger set of values, but width seems to be reliably pixels - // this is against the CSSOM draft spec: http://dev.w3.org/csswg/cssom/#resolved-values + // this is against the CSSOM draft spec: https://dev.w3.org/csswg/cssom/#resolved-values if ( rnumnonpx.test( ret ) && rmargin.test( name ) ) { // Remember the original values @@ -8729,7 +8729,7 @@ if ( xhrSupported ) { // Firefox throws exceptions when accessing properties // of an xhr when a network error occurred - // http://helpful.knobs-dials.com/index.php/Component_returned_failure_code:_0x80040111_(NS_ERROR_NOT_AVAILABLE) + // https://helpful.knobs-dials.com/index.php/Component_returned_failure_code:_0x80040111_(NS_ERROR_NOT_AVAILABLE) try { // Was never called and is aborted or complete diff --git a/js/test/SpecRunner.html b/js/test/SpecRunner.html index 877cfa2b..66bdd3b6 100644 --- a/js/test/SpecRunner.html +++ b/js/test/SpecRunner.html @@ -4,7 +4,7 @@ title: Your Project Name Here --- + "https://www.w3.org/TR/html4/loose.dtd"> Jasmine Spec Runner diff --git a/js/test/lib/support/mock-ajax.js b/js/test/lib/support/mock-ajax.js index 5c99627a..bf17886f 100644 --- a/js/test/lib/support/mock-ajax.js +++ b/js/test/lib/support/mock-ajax.js @@ -4,9 +4,9 @@ Supports both Prototype.js and jQuery. - http://github.com/pivotal/jasmine-ajax + https://github.com/pivotal/jasmine-ajax - Jasmine Home page: http://pivotal.github.com/jasmine + Jasmine Home page: https://pivotal.github.com/jasmine Copyright (c) 2008-2010 Pivotal Labs diff --git a/js/test/spec/QuickStartWidgetSpec.js b/js/test/spec/QuickStartWidgetSpec.js index b5587776..3bafa1d0 100644 --- a/js/test/spec/QuickStartWidgetSpec.js +++ b/js/test/spec/QuickStartWidgetSpec.js @@ -6,18 +6,18 @@ describe("QuickStartWidget", function () { var project = new Spring.Project({ "id": "spring-data-jpa", "name": "Spring Data JPA", - "repoUrl": "http://github.com/SpringSource/spring-data-jpa", - "siteUrl": "http://projects.spring.io/spring-data-jpa", + "repoUrl": "https://github.com/SpringSource/spring-data-jpa", + "siteUrl": "https://projects.spring.io/spring-data-jpa", "projectReleases": [ { - "refDocUrl": "http://docs.spring.io/spring-data/jpa/docs/1.4.0.RC1/reference/html/", - "apiDocUrl": "http://docs.spring.io/spring-data/jpa/docs/1.4.0.RC1/api/", + "refDocUrl": "https://docs.spring.io/spring-data/jpa/docs/1.4.0.RC1/reference/html/", + "apiDocUrl": "https://docs.spring.io/spring-data/jpa/docs/1.4.0.RC1/api/", "groupId": "org.springframework.data", "artifactId": "spring-data-jpa", "repository": { "id": "spring-milestones", "name": "Spring Milestones", - "url": "http://repo.spring.io/milestone", + "url": "https://repo.spring.io/milestone", "snapshotsEnabled": false }, "version": "1.4.0.RC1", @@ -28,8 +28,8 @@ describe("QuickStartWidget", function () { "versionDisplayName": "1.4.0.RC1" }, { - "refDocUrl": "http://docs.spring.io/spring-data/jpa/docs/1.3.4.RELEASE/reference/html/", - "apiDocUrl": "http://docs.spring.io/spring-data/jpa/docs/1.3.4.RELEASE/api/", + "refDocUrl": "https://docs.spring.io/spring-data/jpa/docs/1.3.4.RELEASE/reference/html/", + "apiDocUrl": "https://docs.spring.io/spring-data/jpa/docs/1.3.4.RELEASE/api/", "groupId": "org.springframework.data", "artifactId": "spring-data-jpa", "repository": null, @@ -73,7 +73,7 @@ describe("QuickStartWidget", function () { expect($('#maven_widget')).toContainText("spring-milestones"); expect($('#maven_widget')).toContainText("Spring Milestones"); - expect($('#maven_widget')).toContainText("http://repo.spring.io/milestone"); + expect($('#maven_widget')).toContainText("https://repo.spring.io/milestone"); expect($('#maven_widget')).toContainText("false"); }); @@ -83,7 +83,7 @@ describe("QuickStartWidget", function () { expect($('#maven_widget')).not.toContainText("repository"); expect($('#maven_widget')).not.toContainText("spring-milestones"); expect($('#maven_widget')).not.toContainText("Spring Milestones"); - expect($('#maven_widget')).not.toContainText("http://repo.spring.io/milestone"); + expect($('#maven_widget')).not.toContainText("https://repo.spring.io/milestone"); expect($('#maven_widget')).not.toContainText("false"); }); }); @@ -102,7 +102,7 @@ describe("QuickStartWidget", function () { $('#jasmine_content select').val(0).change(); expect($('#maven_widget')).toContainText("repositories"); - expect($('#maven_widget')).toContainText("http://repo.spring.io/milestone"); + expect($('#maven_widget')).toContainText("https://repo.spring.io/milestone"); }); }); }); diff --git a/js/underscore.js b/js/underscore.js index 7d4ee27c..f5df8e03 100644 --- a/js/underscore.js +++ b/js/underscore.js @@ -1,5 +1,5 @@ // Underscore.js 1.5.1 -// http://underscorejs.org +// https://underscorejs.org // (c) 2009-2013 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors // Underscore may be freely distributed under the MIT license. @@ -554,7 +554,7 @@ // Generate an integer Array containing an arithmetic progression. A port of // the native Python `range()` function. See - // [the Python documentation](http://docs.python.org/library/functions.html#range). + // [the Python documentation](https://docs.python.org/library/functions.html#range). _.range = function(start, stop, step) { if (arguments.length <= 1) { stop = start || 0; @@ -844,7 +844,7 @@ // Internal recursive comparison function for `isEqual`. var eq = function(a, b, aStack, bStack) { // Identical objects are equal. `0 === -0`, but they aren't identical. - // See the [Harmony `egal` proposal](http://wiki.ecmascript.org/doku.php?id=harmony:egal). + // See the [Harmony `egal` proposal](https://wiki.ecmascript.org/doku.php?id=harmony:egal). if (a === b) return a !== 0 || 1 / a == 1 / b; // A strict comparison is necessary because `null == undefined`. if (a == null || b == null) return a === b; diff --git a/multi/multi_spring-cloud-consul-bus.html b/multi/multi_spring-cloud-consul-bus.html index 680090bd..7f1c6b2a 100644 --- a/multi/multi_spring-cloud-consul-bus.html +++ b/multi/multi_spring-cloud-consul-bus.html @@ -1,3 +1,3 @@ - 6. Spring Cloud Bus with Consul

6. Spring Cloud Bus with Consul

6.1 How to activate

To get started with the Consul Bus use the starter with group org.springframework.cloud and artifact id spring-cloud-starter-consul-bus. See the Spring Cloud Project page for details on setting up your build system with the current Spring Cloud Release Train.

See the Spring Cloud Bus documentation for the available actuator endpoints and howto send custom messages.

\ No newline at end of file + 6. Spring Cloud Bus with Consul

6. Spring Cloud Bus with Consul

6.1 How to activate

To get started with the Consul Bus use the starter with group org.springframework.cloud and artifact id spring-cloud-starter-consul-bus. See the Spring Cloud Project page for details on setting up your build system with the current Spring Cloud Release Train.

See the Spring Cloud Bus documentation for the available actuator endpoints and howto send custom messages.

\ No newline at end of file diff --git a/multi/multi_spring-cloud-consul-config.html b/multi/multi_spring-cloud-consul-config.html index 7d17e08c..4dbe923e 100644 --- a/multi/multi_spring-cloud-consul-config.html +++ b/multi/multi_spring-cloud-consul-config.html @@ -3,7 +3,7 @@ 4. Distributed Configuration with Consul

4. Distributed Configuration with Consul

Consul provides a Key/Value Store for storing configuration and other metadata. Spring Cloud Consul Config is an alternative to the Config Server and Client. Configuration is loaded into the Spring Environment during the special "bootstrap" phase. Configuration is stored in the /config folder by default. Multiple PropertySource instances are created based on the application’s name and the active profiles that mimicks the Spring Cloud Config order of resolving properties. For example, an application with the name "testApp" and with the "dev" profile will have the following property sources created:

config/testApp,dev/
 config/testApp/
 config/application,dev/
-config/application/

The most specific property source is at the top, with the least specific at the bottom. Properties in the config/application folder are applicable to all applications using consul for configuration. Properties in the config/testApp folder are only available to the instances of the service named "testApp".

Configuration is currently read on startup of the application. Sending a HTTP POST to /refresh will cause the configuration to be reloaded. Section 4.3, “Config Watch” will also automatically detect changes and reload the application context.

4.1 How to activate

To get started with Consul Configuration use the starter with group org.springframework.cloud and artifact id spring-cloud-starter-consul-config. See the Spring Cloud Project page for details on setting up your build system with the current Spring Cloud Release Train.

This will enable auto-configuration that will setup Spring Cloud Consul Config.

4.2 Customizing

Consul Config may be customized using the following properties:

bootstrap.yml.  +config/application/

The most specific property source is at the top, with the least specific at the bottom. Properties in the config/application folder are applicable to all applications using consul for configuration. Properties in the config/testApp folder are only available to the instances of the service named "testApp".

Configuration is currently read on startup of the application. Sending a HTTP POST to /refresh will cause the configuration to be reloaded. Section 4.3, “Config Watch” will also automatically detect changes and reload the application context.

4.1 How to activate

To get started with Consul Configuration use the starter with group org.springframework.cloud and artifact id spring-cloud-starter-consul-config. See the Spring Cloud Project page for details on setting up your build system with the current Spring Cloud Release Train.

This will enable auto-configuration that will setup Spring Cloud Consul Config.

4.2 Customizing

Consul Config may be customized using the following properties:

bootstrap.yml. 

spring:
   cloud:
     consul:
diff --git a/multi/multi_spring-cloud-consul-discovery.html b/multi/multi_spring-cloud-consul-discovery.html
index b3746500..2e260dd4 100644
--- a/multi/multi_spring-cloud-consul-discovery.html
+++ b/multi/multi_spring-cloud-consul-discovery.html
@@ -1,6 +1,6 @@
 
       
-   3. Service Discovery with Consul

3. Service Discovery with Consul

Service Discovery is one of the key tenets of a microservice based architecture. Trying to hand configure each client or some form of convention can be very difficult to do and can be very brittle. Consul provides Service Discovery services via an HTTP API and DNS. Spring Cloud Consul leverages the HTTP API for service registration and discovery. This does not prevent non-Spring Cloud applications from leveraging the DNS interface. Consul Agents servers are run in a cluster that communicates via a gossip protocol and uses the Raft consensus protocol.

3.1 How to activate

To activate Consul Service Discovery use the starter with group org.springframework.cloud and artifact id spring-cloud-starter-consul-discovery. See the Spring Cloud Project page for details on setting up your build system with the current Spring Cloud Release Train.

3.2 Registering with Consul

When a client registers with Consul, it provides meta-data about itself such as host and port, id, name and tags. An HTTP Check is created by default that Consul hits the /health endpoint every 10 seconds. If the health check fails, the service instance is marked as critical.

Example Consul client:

@SpringBootApplication
+   3. Service Discovery with Consul

3. Service Discovery with Consul

Service Discovery is one of the key tenets of a microservice based architecture. Trying to hand configure each client or some form of convention can be very difficult to do and can be very brittle. Consul provides Service Discovery services via an HTTP API and DNS. Spring Cloud Consul leverages the HTTP API for service registration and discovery. This does not prevent non-Spring Cloud applications from leveraging the DNS interface. Consul Agents servers are run in a cluster that communicates via a gossip protocol and uses the Raft consensus protocol.

3.1 How to activate

To activate Consul Service Discovery use the starter with group org.springframework.cloud and artifact id spring-cloud-starter-consul-discovery. See the Spring Cloud Project page for details on setting up your build system with the current Spring Cloud Release Train.

3.2 Registering with Consul

When a client registers with Consul, it provides meta-data about itself such as host and port, id, name and tags. An HTTP Check is created by default that Consul hits the /health endpoint every 10 seconds. If the health check fails, the service instance is marked as critical.

Example Consul client:

@SpringBootApplication
 @RestController
 public class Application {
 
@@ -86,7 +86,7 @@ spring.cloud.consul.discovery.management-tags

3.4 Looking up services

3.4.1 Using Ribbon

Spring Cloud has support for Feign (a REST client builder) and also Spring RestTemplate -for looking up services using the logical service names/ids instead of physical URLs. Both Feign and the discovery-aware RestTemplate utilize Ribbon for client-side load balancing.

If you want to access service STORES using the RestTemplate simply declare:

@LoadBalanced
+for looking up services using the logical service names/ids instead of physical URLs. Both Feign and the discovery-aware RestTemplate utilize Ribbon for client-side load balancing.

If you want to access service STORES using the RestTemplate simply declare:

@LoadBalanced
 @Bean
 public RestTemplate loadbalancedRestTemplate() {
      new RestTemplate();
diff --git a/multi/multi_spring-cloud-consul-hystrix.html b/multi/multi_spring-cloud-consul-hystrix.html
index 89b0e340..daef72b5 100644
--- a/multi/multi_spring-cloud-consul-hystrix.html
+++ b/multi/multi_spring-cloud-consul-hystrix.html
@@ -1,3 +1,3 @@
 
       
-   7. Circuit Breaker with Hystrix

7. Circuit Breaker with Hystrix

Applications can use the Hystrix Circuit Breaker provided by the Spring Cloud Netflix project by including this starter in the projects pom.xml: spring-cloud-starter-hystrix. Hystrix doesn’t depend on the Netflix Discovery Client. The @EnableHystrix annotation should be placed on a configuration class (usually the main class). Then methods can be annotated with @HystrixCommand to be protected by a circuit breaker. See the documentation for more details.

\ No newline at end of file + 7. Circuit Breaker with Hystrix

7. Circuit Breaker with Hystrix

Applications can use the Hystrix Circuit Breaker provided by the Spring Cloud Netflix project by including this starter in the projects pom.xml: spring-cloud-starter-hystrix. Hystrix doesn’t depend on the Netflix Discovery Client. The @EnableHystrix annotation should be placed on a configuration class (usually the main class). Then methods can be annotated with @HystrixCommand to be protected by a circuit breaker. See the documentation for more details.

\ No newline at end of file diff --git a/single/spring-cloud-consul.html b/single/spring-cloud-consul.html index 7616c296..f3ba98c6 100644 --- a/single/spring-cloud-consul.html +++ b/single/spring-cloud-consul.html @@ -6,7 +6,7 @@ simple annotations you can quickly enable and configure the common patterns insi application and build large distributed systems with Consul based components. The patterns provided include Service Discovery, Control Bus and Configuration. Intelligent Routing (Zuul) and Client Side Load Balancing (Ribbon), Circuit Breaker -(Hystrix) are provided by integration with Spring Cloud Netflix.

1. Install Consul

Please see the installation documentation for instructions on how to install Consul.

2. Consul Agent

A Consul Agent client must be available to all Spring Cloud Consul applications. By default, the Agent client is expected to be at localhost:8500. See the Agent documentation for specifics on how to start an Agent client and how to connect to a cluster of Consul Agent Servers. For development, after you have installed consul, you may start a Consul Agent using the following command:

./src/main/bash/local_run_consul.sh

This will start an agent in server mode on port 8500, with the ui available at http://localhost:8500

3. Service Discovery with Consul

Service Discovery is one of the key tenets of a microservice based architecture. Trying to hand configure each client or some form of convention can be very difficult to do and can be very brittle. Consul provides Service Discovery services via an HTTP API and DNS. Spring Cloud Consul leverages the HTTP API for service registration and discovery. This does not prevent non-Spring Cloud applications from leveraging the DNS interface. Consul Agents servers are run in a cluster that communicates via a gossip protocol and uses the Raft consensus protocol.

3.1 How to activate

To activate Consul Service Discovery use the starter with group org.springframework.cloud and artifact id spring-cloud-starter-consul-discovery. See the Spring Cloud Project page for details on setting up your build system with the current Spring Cloud Release Train.

3.2 Registering with Consul

When a client registers with Consul, it provides meta-data about itself such as host and port, id, name and tags. An HTTP Check is created by default that Consul hits the /health endpoint every 10 seconds. If the health check fails, the service instance is marked as critical.

Example Consul client:

@SpringBootApplication
+(Hystrix) are provided by integration with Spring Cloud Netflix.

1. Install Consul

Please see the installation documentation for instructions on how to install Consul.

2. Consul Agent

A Consul Agent client must be available to all Spring Cloud Consul applications. By default, the Agent client is expected to be at localhost:8500. See the Agent documentation for specifics on how to start an Agent client and how to connect to a cluster of Consul Agent Servers. For development, after you have installed consul, you may start a Consul Agent using the following command:

./src/main/bash/local_run_consul.sh

This will start an agent in server mode on port 8500, with the ui available at http://localhost:8500

3. Service Discovery with Consul

Service Discovery is one of the key tenets of a microservice based architecture. Trying to hand configure each client or some form of convention can be very difficult to do and can be very brittle. Consul provides Service Discovery services via an HTTP API and DNS. Spring Cloud Consul leverages the HTTP API for service registration and discovery. This does not prevent non-Spring Cloud applications from leveraging the DNS interface. Consul Agents servers are run in a cluster that communicates via a gossip protocol and uses the Raft consensus protocol.

3.1 How to activate

To activate Consul Service Discovery use the starter with group org.springframework.cloud and artifact id spring-cloud-starter-consul-discovery. See the Spring Cloud Project page for details on setting up your build system with the current Spring Cloud Release Train.

3.2 Registering with Consul

When a client registers with Consul, it provides meta-data about itself such as host and port, id, name and tags. An HTTP Check is created by default that Consul hits the /health endpoint every 10 seconds. If the health check fails, the service instance is marked as critical.

Example Consul client:

@SpringBootApplication
 @RestController
 public class Application {
 
@@ -92,7 +92,7 @@ spring.cloud.consul.discovery.management-tags

3.4 Looking up services

3.4.1 Using Ribbon

Spring Cloud has support for Feign (a REST client builder) and also Spring RestTemplate -for looking up services using the logical service names/ids instead of physical URLs. Both Feign and the discovery-aware RestTemplate utilize Ribbon for client-side load balancing.

If you want to access service STORES using the RestTemplate simply declare:

@LoadBalanced
+for looking up services using the logical service names/ids instead of physical URLs. Both Feign and the discovery-aware RestTemplate utilize Ribbon for client-side load balancing.

If you want to access service STORES using the RestTemplate simply declare:

@LoadBalanced
 @Bean
 public RestTemplate loadbalancedRestTemplate() {
      new RestTemplate();
@@ -115,7 +115,7 @@ public String serviceUrl() {
 }

3.5 Consul Catalog Watch

The Consul Catalog Watch takes advantage of the ability of consul to watch services. The Catalog Watch makes a blocking Consul HTTP API call to determine if any services have changed. If there is new service data a Heartbeat Event is published.

To change the frequency of when the Config Watch is called change spring.cloud.consul.config.discovery.catalog-services-watch-delay. The default value is 1000, which is in milliseconds. The delay is the amount of time after the end of the previous invocation and the start of the next.

To disable the Catalog Watch set spring.cloud.consul.discovery.catalogServicesWatch.enabled=false.

The watch uses a Spring TaskScheduler to schedule the call to consul. By default it is a ThreadPoolTaskScheduler with a poolSize of 1. To change the TaskScheduler, create a bean of type TaskScheduler named with the ConsulDiscoveryClientConfiguration.CATALOG_WATCH_TASK_SCHEDULER_NAME constant.

4. Distributed Configuration with Consul

Consul provides a Key/Value Store for storing configuration and other metadata. Spring Cloud Consul Config is an alternative to the Config Server and Client. Configuration is loaded into the Spring Environment during the special "bootstrap" phase. Configuration is stored in the /config folder by default. Multiple PropertySource instances are created based on the application’s name and the active profiles that mimicks the Spring Cloud Config order of resolving properties. For example, an application with the name "testApp" and with the "dev" profile will have the following property sources created:

config/testApp,dev/
 config/testApp/
 config/application,dev/
-config/application/

The most specific property source is at the top, with the least specific at the bottom. Properties in the config/application folder are applicable to all applications using consul for configuration. Properties in the config/testApp folder are only available to the instances of the service named "testApp".

Configuration is currently read on startup of the application. Sending a HTTP POST to /refresh will cause the configuration to be reloaded. Section 4.3, “Config Watch” will also automatically detect changes and reload the application context.

4.1 How to activate

To get started with Consul Configuration use the starter with group org.springframework.cloud and artifact id spring-cloud-starter-consul-config. See the Spring Cloud Project page for details on setting up your build system with the current Spring Cloud Release Train.

This will enable auto-configuration that will setup Spring Cloud Consul Config.

4.2 Customizing

Consul Config may be customized using the following properties:

bootstrap.yml.  +config/application/

The most specific property source is at the top, with the least specific at the bottom. Properties in the config/application folder are applicable to all applications using consul for configuration. Properties in the config/testApp folder are only available to the instances of the service named "testApp".

Configuration is currently read on startup of the application. Sending a HTTP POST to /refresh will cause the configuration to be reloaded. Section 4.3, “Config Watch” will also automatically detect changes and reload the application context.

4.1 How to activate

To get started with Consul Configuration use the starter with group org.springframework.cloud and artifact id spring-cloud-starter-consul-config. See the Spring Cloud Project page for details on setting up your build system with the current Spring Cloud Release Train.

This will enable auto-configuration that will setup Spring Cloud Consul Config.

4.2 Customizing

Consul Config may be customized using the following properties:

bootstrap.yml. 

spring:
   cloud:
     consul:
@@ -155,7 +155,7 @@ exponential multiplier of 1.1 for subsequent backoffs. You can configure these
 properties (and others) using spring.cloud.consul.retry.* configuration properties.
 This works with both Spring Cloud Consul Config and Discovery registration.

[Tip]Tip

To take full control of the retry add a @Bean of type RetryOperationsInterceptor with id "consulRetryInterceptor". Spring -Retry has a RetryInterceptorBuilder that makes it easy to create one.

6. Spring Cloud Bus with Consul

6.1 How to activate

To get started with the Consul Bus use the starter with group org.springframework.cloud and artifact id spring-cloud-starter-consul-bus. See the Spring Cloud Project page for details on setting up your build system with the current Spring Cloud Release Train.

See the Spring Cloud Bus documentation for the available actuator endpoints and howto send custom messages.

7. Circuit Breaker with Hystrix

Applications can use the Hystrix Circuit Breaker provided by the Spring Cloud Netflix project by including this starter in the projects pom.xml: spring-cloud-starter-hystrix. Hystrix doesn’t depend on the Netflix Discovery Client. The @EnableHystrix annotation should be placed on a configuration class (usually the main class). Then methods can be annotated with @HystrixCommand to be protected by a circuit breaker. See the documentation for more details.

8. Hystrix metrics aggregation with Turbine and Consul

Turbine (provided by the Spring Cloud Netflix project), aggregates multiple instances Hystrix metrics streams, so the dashboard can display an aggregate view. Turbine uses the DiscoveryClient interface to lookup relevant instances. To use Turbine with Spring Cloud Consul, configure the Turbine application in a manner similar to the following examples:

pom.xml.  +Retry has a RetryInterceptorBuilder that makes it easy to create one.

6. Spring Cloud Bus with Consul

6.1 How to activate

To get started with the Consul Bus use the starter with group org.springframework.cloud and artifact id spring-cloud-starter-consul-bus. See the Spring Cloud Project page for details on setting up your build system with the current Spring Cloud Release Train.

See the Spring Cloud Bus documentation for the available actuator endpoints and howto send custom messages.

7. Circuit Breaker with Hystrix

Applications can use the Hystrix Circuit Breaker provided by the Spring Cloud Netflix project by including this starter in the projects pom.xml: spring-cloud-starter-hystrix. Hystrix doesn’t depend on the Netflix Discovery Client. The @EnableHystrix annotation should be placed on a configuration class (usually the main class). Then methods can be annotated with @HystrixCommand to be protected by a circuit breaker. See the documentation for more details.

8. Hystrix metrics aggregation with Turbine and Consul

Turbine (provided by the Spring Cloud Netflix project), aggregates multiple instances Hystrix metrics streams, so the dashboard can display an aggregate view. Turbine uses the DiscoveryClient interface to lookup relevant instances. To use Turbine with Spring Cloud Consul, configure the Turbine application in a manner similar to the following examples:

pom.xml. 

<dependency>
     <groupId>org.springframework.cloud</groupId>
     <artifactId>spring-cloud-netflix-turbine</artifactId>
diff --git a/spring-cloud-consul.html b/spring-cloud-consul.html
index 4c1eeab8..67e69ae7 100644
--- a/spring-cloud-consul.html
+++ b/spring-cloud-consul.html
@@ -33,7 +33,7 @@
 	color: #ffffff;
 }
 
-
+