Understanding Eclipse MicroProfile Fault Tolerance
Fault Tolerance provides a collection of tools that prevent code from failing by making it more resilient. Most of these tools are inspired by development good practices (such as retry or fallback) or well-known development patterns (such as circuit breaker or bulkhead).
Fault Tolerance is based on CDI and, more precisely, on the CDI interceptor implementation. It also relies on the MicroProfile Config specification to allow external configuration for Fault Tolerance policies.
The main idea of the specification is to decouple business logic from Fault Tolerance boilerplate code. To achieve that, the specification defines interceptor-binding annotations to apply Fault Tolerance policies on a method execution or on a class (in that case, all class methods have the same policy).
Policies included in the Fault Tolerance specification are the following:
- Timeout: This is applied with the @Timeout annotation. It adds a timeout to the current operation.
- Retry: This is applied with the @Retry annotation. It adds retry behavior and allows its configuration on the current operation.
- Fallback: This is applied with the @Fallback annotation. It defines the code to execute, should the current operation fail.
- Bulkhead: This is applied with the @Bulkhead annotation. It isolates failures in the current operation to preserve the execution of other operations.
- Circuit Breaker: This is applied with the @CircuitBreaker annotation. It provides an automatic fast failing execution to prevent overloading the system.
- Asynchronous: This is applied with the @Asynchronous annotation. It makes the current operation asynchronous (that is, code will be invoked asynchronously).
Applying one or more of these policies is as easy as adding the required annotations on the method (or the class) for which you'd like to have these policies enabled. So, using Fault Tolerance is rather simple. But this simplicity doesn't prevent flexibility, thanks to all of the configuration parameters available for each policy.
Right now, the following vendors provide an implementation for the Fault Tolerance specification:
- Red Hat in Thorntail and Quarkus
- IBM in Open Liberty
- Payara in Payara Server
- Apache Safeguard for Hammock and TomEE
- KumuluzEE for KumuluzEE framework
All of these implementations support Fault Tolerance and hence support the same set of features that are described in the next section.
- Aptana Studio Beginner's Guide
- 物聯(lián)網(wǎng)工程規(guī)劃技術(shù)
- Building Django 2.0 Web Applications
- 智能網(wǎng)聯(lián)汽車V2X與智能網(wǎng)聯(lián)設(shè)施I2X
- INSTANT PhpStorm Starter
- Hands-On Chatbot Development with Alexa Skills and Amazon Lex
- 萬物互聯(lián):蜂窩物聯(lián)網(wǎng)組網(wǎng)技術(shù)詳解
- 中國互聯(lián)網(wǎng)發(fā)展報告2018
- IPv6網(wǎng)絡(luò)切片:使能千行百業(yè)新體驗
- Learning Storm
- 工業(yè)互聯(lián)網(wǎng)創(chuàng)新實踐
- 物聯(lián)網(wǎng)工程概論
- 5G+區(qū)塊鏈
- 異構(gòu)蜂窩網(wǎng)絡(luò)關(guān)鍵理論與技術(shù)
- 組網(wǎng)技術(shù)與網(wǎng)絡(luò)管理