7 Resilience strategies

 

This chapter covers

  • The importance of building resilient applications
  • MicroProfile Fault Tolerance strategies
  • When and 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, which 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 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 Updating 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 Avoiding repeated failure with circuit breakers

 
 
 

7.8.1 MicroProfile Fault Tolerance: @CircuitBreaker

 
 

7.8.2 How a circuit breaker works

 
 

7.8.3 Updating the TransactionService to use @CircuitBreaker

 
 

7.8.4 Testing the circuit breaker

 
 
 
 

7.9 Overriding annotation parameter values using properties

 
 

7.10 Deploying to Kubernetes

 

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