7 Resilience Strategies

 

This chapter covers:

  • The importance of building resilient applications
  • MicroProfile Fault Tolerance strategies
  • When to apply each fault tolerance strategy
  • How to apply each fault tolerance strategy
  • How to configure and disable fault tolerance annotations using properties

Application robustness is critically important in a microservices architecture, where there are many service interdependencies. A microservices architecture can have many service interdependencies. A service susceptible to failure can negatively impact other services. This chapter covers using resilience patterns to improve application robustness to maintain overall health.

7.1 Resilience Strategies Overview

Services will eventually experience downtime, whether planned or unplanned. A service can reduce its downtime using resilience strategies when the services it depends on are unreliable or unavailable.

Quarkus offers its resilience strategies using the MicroProfile Fault Tolerance APIs. These annotation-based APIs are applied to classes or methods, standalone or in combination. Table 7.1 lists the available fault tolerance annotations.

7.2 Executing a method under a separate thread with @Asynchronous

 

7.3 Constraining concurrency with bulkheads

 
 
 

7.4 Update a TransactionService with a bulkhead

 
 
 

7.5 Exception handling with Fallbacks

 
 
 

7.6 Defining execution Timeouts

 

7.7 Recovering from temporary failure with Retry

 

7.8 Avoid repeated failure with Circuit Breakers

 
 
 

7.8.1 MicroProfile Fault Tolerance - @CircuitBreaker

 
 
 

7.8.2 How a circuit breaker works

 
 
 

7.8.3 Updating TransactionService to use @CircuitBreaker

 
 

7.8.4 Test the circuit breaker

 
 

7.9 Override annotation parameter values using properties

 
 

7.10 Deploy to Kubernetes

 
 
 
 

7.11 Summary

 
 
 
 
sitemap

Unable to load book!

The book could not be loaded.

(try again in a couple of minutes)

manning.com homepage
test yourself with a liveTest