diff --git a/multi/multi__circuit_breaker_hystrix_clients.html b/multi/multi__circuit_breaker_hystrix_clients.html index e94c031f3..72f82e25a 100644 --- a/multi/multi__circuit_breaker_hystrix_clients.html +++ b/multi/multi__circuit_breaker_hystrix_clients.html @@ -1,9 +1,9 @@ 3. Circuit Breaker: Hystrix Clients

3. Circuit Breaker: Hystrix Clients

Netflix has created a library called Hystrix that implements the circuit breaker pattern. -In a microservice architecture, it is common to have multiple layers of service calls, as shown in the following example:

Figure 3.1. Microservice Graph

Hystrix

A service failure in the lower level of services can cause cascading failure all the way up to the user. +In a microservice architecture, it is common to have multiple layers of service calls, as shown in the following example:

Figure 3.1. Microservice Graph

Hystrix

A service failure in the lower level of services can cause cascading failure all the way up to the user. When calls to a particular service exceed circuitBreaker.requestVolumeThreshold (default: 20 requests) and the failure percentage is greater than circuitBreaker.errorThresholdPercentage (default: >50%) in a rolling window defined by metrics.rollingStats.timeInMilliseconds (default: 10 seconds), the circuit opens and the call is not made. -In cases of error and an open circuit, a fallback can be provided by the developer.

Figure 3.2. Hystrix fallback prevents cascading failures

HystrixFallback

Having an open circuit stops cascading failures and allows overwhelmed or failing services time to recover. +In cases of error and an open circuit, a fallback can be provided by the developer.

Figure 3.2. Hystrix fallback prevents cascading failures

HystrixFallback

Having an open circuit stops cascading failures and allows overwhelmed or failing services time to recover. The fallback can be another Hystrix protected call, static data, or a sensible empty value. Fallbacks may be chained so that the first fallback makes some other business call, which in turn falls back to static data.

3.1 How to Include Hystrix

To include Hystrix in your project, use the starter with a group ID of org.springframework.cloud and a artifact ID of spring-cloud-starter-netflix-hystrix. diff --git a/multi/multi__circuit_breaker_hystrix_dashboard.html b/multi/multi__circuit_breaker_hystrix_dashboard.html index e2f580411..2dcc511c1 100644 --- a/multi/multi__circuit_breaker_hystrix_dashboard.html +++ b/multi/multi__circuit_breaker_hystrix_dashboard.html @@ -1,4 +1,4 @@ 4. Circuit Breaker: Hystrix Dashboard

4. Circuit Breaker: Hystrix Dashboard

One of the main benefits of Hystrix is the set of metrics it gathers about each HystrixCommand. -The Hystrix Dashboard displays the health of each circuit breaker in an efficient manner.

Figure 4.1. Hystrix Dashboard

Hystrix

\ No newline at end of file +The Hystrix Dashboard displays the health of each circuit breaker in an efficient manner.

Figure 4.1. Hystrix Dashboard

Hystrix

\ No newline at end of file diff --git a/multi/multi_spring-cloud-eureka-server.html b/multi/multi_spring-cloud-eureka-server.html index ed18c2cff..128a45cbe 100644 --- a/multi/multi_spring-cloud-eureka-server.html +++ b/multi/multi_spring-cloud-eureka-server.html @@ -109,4 +109,19 @@ For example:

"/eureka/**");
         super.configure(http);
     }
-}

For more information on CSRF see the Spring Security documentation.

A demo Eureka Server can be found in the Spring Cloud Samples repo.

\ No newline at end of file +}

For more information on CSRF see the Spring Security documentation.

A demo Eureka Server can be found in the Spring Cloud Samples repo.

2.8 JDK 11 Support

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.

<dependency>
+    <groupId>javax.xml.bind</groupId>
+    <artifactId>jaxb-api</artifactId>
+    <version>2.3.0</version>
+</dependency>
+<dependency>
+    <groupId>com.sun.xml.bind</groupId>
+    <artifactId>jaxb-core</artifactId>
+    <version>2.3.0</version>
+</dependency>
+<dependency>
+    <groupId>com.sun.xml.bind</groupId>
+    <artifactId>jaxb-impl</artifactId>
+    <version>2.3.0</version>
+</dependency>
\ No newline at end of file diff --git a/multi/multi_spring-cloud-netflix.html b/multi/multi_spring-cloud-netflix.html index 5b67c0e5a..a76a756b3 100644 --- a/multi/multi_spring-cloud-netflix.html +++ b/multi/multi_spring-cloud-netflix.html @@ -1,3 +1,3 @@ - Spring Cloud Netflix

Spring Cloud Netflix


Table of Contents

1. Service Discovery: Eureka Clients
1.1. How to Include Eureka Client
1.2. Registering with Eureka
1.3. Authenticating with the Eureka Server
1.4. Status Page and Health Indicator
1.5. Registering a Secure Application
1.6. Eureka’s Health Checks
1.7. Eureka Metadata for Instances and Clients
1.7.1. Using Eureka on Cloud Foundry
1.7.2. Using Eureka on AWS
1.7.3. Changing the Eureka Instance ID
1.8. Using the EurekaClient
1.8.1. EurekaClient without Jersey
1.9. Alternatives to the Native Netflix EurekaClient
1.10. Why Is It so Slow to Register a Service?
1.11. Zones
2. Service Discovery: Eureka Server
2.1. How to Include Eureka Server
2.2. How to Run a Eureka Server
2.3. High Availability, Zones and Regions
2.4. Standalone Mode
2.5. Peer Awareness
2.6. When to Prefer IP Address
2.7. Securing The Eureka Server
3. Circuit Breaker: Hystrix Clients
3.1. How to Include Hystrix
3.2. Propagating the Security Context or Using Spring Scopes
3.3. Health Indicator
3.4. Hystrix Metrics Stream
4. Circuit Breaker: Hystrix Dashboard
5. Hystrix Timeouts And Ribbon Clients
5.1. How to Include the Hystrix Dashboard
5.2. Turbine
5.2.1. Clusters Endpoint
5.3. Turbine Stream
6. Client Side Load Balancer: Ribbon
6.1. How to Include Ribbon
6.2. Customizing the Ribbon Client
6.3. Customizing the Default for All Ribbon Clients
6.4. Customizing the Ribbon Client by Setting Properties
6.5. Using Ribbon with Eureka
6.6. Example: How to Use Ribbon Without Eureka
6.7. Example: Disable Eureka Use in Ribbon
6.8. Using the Ribbon API Directly
6.9. Caching of Ribbon Configuration
6.10. How to Configure Hystrix Thread Pools
6.11. How to Provide a Key to Ribbon’s IRule
7. External Configuration: Archaius
8. Router and Filter: Zuul
8.1. How to Include Zuul
8.2. Embedded Zuul Reverse Proxy
8.3. Zuul Http Client
8.4. Cookies and Sensitive Headers
8.5. Ignored Headers
8.6. Management Endpoints
8.6.1. Routes Endpoint
8.6.2. Filters Endpoint
8.7. Strangulation Patterns and Local Forwards
8.8. Uploading Files through Zuul
8.9. Query String Encoding
8.10. Plain Embedded Zuul
8.11. Disable Zuul Filters
8.12. Providing Hystrix Fallbacks For Routes
8.13. Zuul Timeouts
8.14. Rewriting the Location header
8.15. Enabling Cross Origin Requests
8.16. Metrics
8.17. Zuul Developer Guide
8.17.1. The Zuul Servlet
8.17.2. Zuul RequestContext
8.17.3. @EnableZuulProxy vs. @EnableZuulServer
8.17.4. @EnableZuulServer Filters
8.17.5. @EnableZuulProxy Filters
8.17.6. Custom Zuul Filter Examples
How to Write a Pre Filter
How to Write a Route Filter
How to Write a Post Filter
8.17.7. How Zuul Errors Work
8.17.8. Zuul Eager Application Context Loading
9. Polyglot support with Sidecar
10. Retrying Failed Requests
10.1. BackOff Policies
10.2. Configuration
10.2.1. Zuul
11. HTTP Clients
\ No newline at end of file + Spring Cloud Netflix

Spring Cloud Netflix


Table of Contents

1. Service Discovery: Eureka Clients
1.1. How to Include Eureka Client
1.2. Registering with Eureka
1.3. Authenticating with the Eureka Server
1.4. Status Page and Health Indicator
1.5. Registering a Secure Application
1.6. Eureka’s Health Checks
1.7. Eureka Metadata for Instances and Clients
1.7.1. Using Eureka on Cloud Foundry
1.7.2. Using Eureka on AWS
1.7.3. Changing the Eureka Instance ID
1.8. Using the EurekaClient
1.8.1. EurekaClient without Jersey
1.9. Alternatives to the Native Netflix EurekaClient
1.10. Why Is It so Slow to Register a Service?
1.11. Zones
2. Service Discovery: Eureka Server
2.1. How to Include Eureka Server
2.2. How to Run a Eureka Server
2.3. High Availability, Zones and Regions
2.4. Standalone Mode
2.5. Peer Awareness
2.6. When to Prefer IP Address
2.7. Securing The Eureka Server
2.8. JDK 11 Support
3. Circuit Breaker: Hystrix Clients
3.1. How to Include Hystrix
3.2. Propagating the Security Context or Using Spring Scopes
3.3. Health Indicator
3.4. Hystrix Metrics Stream
4. Circuit Breaker: Hystrix Dashboard
5. Hystrix Timeouts And Ribbon Clients
5.1. How to Include the Hystrix Dashboard
5.2. Turbine
5.2.1. Clusters Endpoint
5.3. Turbine Stream
6. Client Side Load Balancer: Ribbon
6.1. How to Include Ribbon
6.2. Customizing the Ribbon Client
6.3. Customizing the Default for All Ribbon Clients
6.4. Customizing the Ribbon Client by Setting Properties
6.5. Using Ribbon with Eureka
6.6. Example: How to Use Ribbon Without Eureka
6.7. Example: Disable Eureka Use in Ribbon
6.8. Using the Ribbon API Directly
6.9. Caching of Ribbon Configuration
6.10. How to Configure Hystrix Thread Pools
6.11. How to Provide a Key to Ribbon’s IRule
7. External Configuration: Archaius
8. Router and Filter: Zuul
8.1. How to Include Zuul
8.2. Embedded Zuul Reverse Proxy
8.3. Zuul Http Client
8.4. Cookies and Sensitive Headers
8.5. Ignored Headers
8.6. Management Endpoints
8.6.1. Routes Endpoint
8.6.2. Filters Endpoint
8.7. Strangulation Patterns and Local Forwards
8.8. Uploading Files through Zuul
8.9. Query String Encoding
8.10. Plain Embedded Zuul
8.11. Disable Zuul Filters
8.12. Providing Hystrix Fallbacks For Routes
8.13. Zuul Timeouts
8.14. Rewriting the Location header
8.15. Enabling Cross Origin Requests
8.16. Metrics
8.17. Zuul Developer Guide
8.17.1. The Zuul Servlet
8.17.2. Zuul RequestContext
8.17.3. @EnableZuulProxy vs. @EnableZuulServer
8.17.4. @EnableZuulServer Filters
8.17.5. @EnableZuulProxy Filters
8.17.6. Custom Zuul Filter Examples
How to Write a Pre Filter
How to Write a Route Filter
How to Write a Post Filter
8.17.7. How Zuul Errors Work
8.17.8. Zuul Eager Application Context Loading
9. Polyglot support with Sidecar
10. Retrying Failed Requests
10.1. BackOff Policies
10.2. Configuration
10.2.1. Zuul
11. HTTP Clients
\ No newline at end of file diff --git a/single/spring-cloud-netflix.html b/single/spring-cloud-netflix.html index d483817bd..c62eaf80c 100644 --- a/single/spring-cloud-netflix.html +++ b/single/spring-cloud-netflix.html @@ -1,6 +1,6 @@ - Spring Cloud Netflix

Spring Cloud Netflix


Table of Contents

1. Service Discovery: Eureka Clients
1.1. How to Include Eureka Client
1.2. Registering with Eureka
1.3. Authenticating with the Eureka Server
1.4. Status Page and Health Indicator
1.5. Registering a Secure Application
1.6. Eureka’s Health Checks
1.7. Eureka Metadata for Instances and Clients
1.7.1. Using Eureka on Cloud Foundry
1.7.2. Using Eureka on AWS
1.7.3. Changing the Eureka Instance ID
1.8. Using the EurekaClient
1.8.1. EurekaClient without Jersey
1.9. Alternatives to the Native Netflix EurekaClient
1.10. Why Is It so Slow to Register a Service?
1.11. Zones
2. Service Discovery: Eureka Server
2.1. How to Include Eureka Server
2.2. How to Run a Eureka Server
2.3. High Availability, Zones and Regions
2.4. Standalone Mode
2.5. Peer Awareness
2.6. When to Prefer IP Address
2.7. Securing The Eureka Server
3. Circuit Breaker: Hystrix Clients
3.1. How to Include Hystrix
3.2. Propagating the Security Context or Using Spring Scopes
3.3. Health Indicator
3.4. Hystrix Metrics Stream
4. Circuit Breaker: Hystrix Dashboard
5. Hystrix Timeouts And Ribbon Clients
5.1. How to Include the Hystrix Dashboard
5.2. Turbine
5.2.1. Clusters Endpoint
5.3. Turbine Stream
6. Client Side Load Balancer: Ribbon
6.1. How to Include Ribbon
6.2. Customizing the Ribbon Client
6.3. Customizing the Default for All Ribbon Clients
6.4. Customizing the Ribbon Client by Setting Properties
6.5. Using Ribbon with Eureka
6.6. Example: How to Use Ribbon Without Eureka
6.7. Example: Disable Eureka Use in Ribbon
6.8. Using the Ribbon API Directly
6.9. Caching of Ribbon Configuration
6.10. How to Configure Hystrix Thread Pools
6.11. How to Provide a Key to Ribbon’s IRule
7. External Configuration: Archaius
8. Router and Filter: Zuul
8.1. How to Include Zuul
8.2. Embedded Zuul Reverse Proxy
8.3. Zuul Http Client
8.4. Cookies and Sensitive Headers
8.5. Ignored Headers
8.6. Management Endpoints
8.6.1. Routes Endpoint
8.6.2. Filters Endpoint
8.7. Strangulation Patterns and Local Forwards
8.8. Uploading Files through Zuul
8.9. Query String Encoding
8.10. Plain Embedded Zuul
8.11. Disable Zuul Filters
8.12. Providing Hystrix Fallbacks For Routes
8.13. Zuul Timeouts
8.14. Rewriting the Location header
8.15. Enabling Cross Origin Requests
8.16. Metrics
8.17. Zuul Developer Guide
8.17.1. The Zuul Servlet
8.17.2. Zuul RequestContext
8.17.3. @EnableZuulProxy vs. @EnableZuulServer
8.17.4. @EnableZuulServer Filters
8.17.5. @EnableZuulProxy Filters
8.17.6. Custom Zuul Filter Examples
How to Write a Pre Filter
How to Write a Route Filter
How to Write a Post Filter
8.17.7. How Zuul Errors Work
8.17.8. Zuul Eager Application Context Loading
9. Polyglot support with Sidecar
10. Retrying Failed Requests
10.1. BackOff Policies
10.2. Configuration
10.2.1. Zuul
11. HTTP Clients

2.1.0.BUILD-SNAPSHOT

This project provides Netflix OSS integrations for Spring Boot apps through autoconfiguration + Spring Cloud Netflix

Spring Cloud Netflix


Table of Contents

1. Service Discovery: Eureka Clients
1.1. How to Include Eureka Client
1.2. Registering with Eureka
1.3. Authenticating with the Eureka Server
1.4. Status Page and Health Indicator
1.5. Registering a Secure Application
1.6. Eureka’s Health Checks
1.7. Eureka Metadata for Instances and Clients
1.7.1. Using Eureka on Cloud Foundry
1.7.2. Using Eureka on AWS
1.7.3. Changing the Eureka Instance ID
1.8. Using the EurekaClient
1.8.1. EurekaClient without Jersey
1.9. Alternatives to the Native Netflix EurekaClient
1.10. Why Is It so Slow to Register a Service?
1.11. Zones
2. Service Discovery: Eureka Server
2.1. How to Include Eureka Server
2.2. How to Run a Eureka Server
2.3. High Availability, Zones and Regions
2.4. Standalone Mode
2.5. Peer Awareness
2.6. When to Prefer IP Address
2.7. Securing The Eureka Server
2.8. JDK 11 Support
3. Circuit Breaker: Hystrix Clients
3.1. How to Include Hystrix
3.2. Propagating the Security Context or Using Spring Scopes
3.3. Health Indicator
3.4. Hystrix Metrics Stream
4. Circuit Breaker: Hystrix Dashboard
5. Hystrix Timeouts And Ribbon Clients
5.1. How to Include the Hystrix Dashboard
5.2. Turbine
5.2.1. Clusters Endpoint
5.3. Turbine Stream
6. Client Side Load Balancer: Ribbon
6.1. How to Include Ribbon
6.2. Customizing the Ribbon Client
6.3. Customizing the Default for All Ribbon Clients
6.4. Customizing the Ribbon Client by Setting Properties
6.5. Using Ribbon with Eureka
6.6. Example: How to Use Ribbon Without Eureka
6.7. Example: Disable Eureka Use in Ribbon
6.8. Using the Ribbon API Directly
6.9. Caching of Ribbon Configuration
6.10. How to Configure Hystrix Thread Pools
6.11. How to Provide a Key to Ribbon’s IRule
7. External Configuration: Archaius
8. Router and Filter: Zuul
8.1. How to Include Zuul
8.2. Embedded Zuul Reverse Proxy
8.3. Zuul Http Client
8.4. Cookies and Sensitive Headers
8.5. Ignored Headers
8.6. Management Endpoints
8.6.1. Routes Endpoint
8.6.2. Filters Endpoint
8.7. Strangulation Patterns and Local Forwards
8.8. Uploading Files through Zuul
8.9. Query String Encoding
8.10. Plain Embedded Zuul
8.11. Disable Zuul Filters
8.12. Providing Hystrix Fallbacks For Routes
8.13. Zuul Timeouts
8.14. Rewriting the Location header
8.15. Enabling Cross Origin Requests
8.16. Metrics
8.17. Zuul Developer Guide
8.17.1. The Zuul Servlet
8.17.2. Zuul RequestContext
8.17.3. @EnableZuulProxy vs. @EnableZuulServer
8.17.4. @EnableZuulServer Filters
8.17.5. @EnableZuulProxy Filters
8.17.6. Custom Zuul Filter Examples
How to Write a Pre Filter
How to Write a Route Filter
How to Write a Post Filter
8.17.7. How Zuul Errors Work
8.17.8. Zuul Eager Application Context Loading
9. Polyglot support with Sidecar
10. Retrying Failed Requests
10.1. BackOff Policies
10.2. Configuration
10.2.1. Zuul
11. HTTP Clients

2.1.0.BUILD-SNAPSHOT

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 @@ -252,10 +252,25 @@ For example:

"/eureka/**");
         super.configure(http);
     }
-}

For more information on CSRF see the Spring Security documentation.

A demo Eureka Server can be found in the Spring Cloud Samples repo.

3. Circuit Breaker: Hystrix Clients

Netflix has created a library called Hystrix that implements the circuit breaker pattern. -In a microservice architecture, it is common to have multiple layers of service calls, as shown in the following example:

Figure 3.1. Microservice Graph

Hystrix

A service failure in the lower level of services can cause cascading failure all the way up to the user. +}

For more information on CSRF see the Spring Security documentation.

A demo Eureka Server can be found in the Spring Cloud Samples repo.

2.8 JDK 11 Support

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.

<dependency>
+    <groupId>javax.xml.bind</groupId>
+    <artifactId>jaxb-api</artifactId>
+    <version>2.3.0</version>
+</dependency>
+<dependency>
+    <groupId>com.sun.xml.bind</groupId>
+    <artifactId>jaxb-core</artifactId>
+    <version>2.3.0</version>
+</dependency>
+<dependency>
+    <groupId>com.sun.xml.bind</groupId>
+    <artifactId>jaxb-impl</artifactId>
+    <version>2.3.0</version>
+</dependency>

3. Circuit Breaker: Hystrix Clients

Netflix has created a library called Hystrix that implements the circuit breaker pattern. +In a microservice architecture, it is common to have multiple layers of service calls, as shown in the following example:

Figure 3.1. Microservice Graph

Hystrix

A service failure in the lower level of services can cause cascading failure all the way up to the user. When calls to a particular service exceed circuitBreaker.requestVolumeThreshold (default: 20 requests) and the failure percentage is greater than circuitBreaker.errorThresholdPercentage (default: >50%) in a rolling window defined by metrics.rollingStats.timeInMilliseconds (default: 10 seconds), the circuit opens and the call is not made. -In cases of error and an open circuit, a fallback can be provided by the developer.

Figure 3.2. Hystrix fallback prevents cascading failures

HystrixFallback

Having an open circuit stops cascading failures and allows overwhelmed or failing services time to recover. +In cases of error and an open circuit, a fallback can be provided by the developer.

Figure 3.2. Hystrix fallback prevents cascading failures

HystrixFallback

Having an open circuit stops cascading failures and allows overwhelmed or failing services time to recover. The fallback can be another Hystrix protected call, static data, or a sensible empty value. Fallbacks may be chained so that the first fallback makes some other business call, which in turn falls back to static data.

3.1 How to Include Hystrix

To include Hystrix in your project, use the starter with a group ID of org.springframework.cloud and a artifact ID of spring-cloud-starter-netflix-hystrix. @@ -311,7 +326,7 @@ Doing so exposes the /actuator/hystrix.stream as a <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-actuator</artifactId> </dependency>

4. Circuit Breaker: Hystrix Dashboard

One of the main benefits of Hystrix is the set of metrics it gathers about each HystrixCommand. -The Hystrix Dashboard displays the health of each circuit breaker in an efficient manner.

Figure 4.1. Hystrix Dashboard

Hystrix

5. Hystrix Timeouts And Ribbon Clients

When using Hystrix commands that wrap Ribbon clients you want to make sure your Hystrix timeout +The Hystrix Dashboard displays the health of each circuit breaker in an efficient manner.

Figure 4.1. Hystrix Dashboard

Hystrix

5. Hystrix Timeouts And Ribbon Clients

When using Hystrix commands that wrap Ribbon clients you want to make sure your Hystrix timeout is configured to be longer than the configured Ribbon timeout, including any potential retries that might be made. For example, if your Ribbon connection timeout is one second and the Ribbon client might retry the request three times, than your Hystrix timeout should diff --git a/spring-cloud-netflix.xml b/spring-cloud-netflix.xml index 8c602ebcf..a6d3169eb 100644 --- a/spring-cloud-netflix.xml +++ b/spring-cloud-netflix.xml @@ -467,6 +467,26 @@ class WebSecurityConfig extends WebSecurityConfigurerAdapter { For more information on CSRF see the Spring Security documentation. A demo Eureka Server can be found in the Spring Cloud Samples repo. +

+JDK 11 Support +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. +<dependency> + <groupId>javax.xml.bind</groupId> + <artifactId>jaxb-api</artifactId> + <version>2.3.0</version> +</dependency> +<dependency> + <groupId>com.sun.xml.bind</groupId> + <artifactId>jaxb-core</artifactId> + <version>2.3.0</version> +</dependency> +<dependency> + <groupId>com.sun.xml.bind</groupId> + <artifactId>jaxb-impl</artifactId> + <version>2.3.0</version> +</dependency> +
Circuit Breaker: Hystrix Clients