GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — java/microprofile-fault-tolerance.md at master · lauracowen/java

Expand file tree

/

microprofile-fault-tolerance.md

Copy path
More file actions
More file actions

Latest commit

 

History

History
History
61 lines (45 loc) · 2.22 KB
/

microprofile-fault-tolerance.md

Copy path

File metadata and controls

61 lines (45 loc) · 2.22 KB
Raw
Copy raw file
Download raw file
Edit and raw actions
copyright
years
2019
lastupdated 2019-02-05

{:new_window: target="_blank"} {:shortdesc: .shortdesc} {:screen: .screen} {:codeblock: .codeblock} {:pre: .pre} {:tip: .tip} {:note: .note} {:important: .important}

Fault Tolerance with MicroProfile

{: #mp-fault-tolerance}

Our recommended approach for these fault tolerance topics is to mainly leverage the features of Istio. See "Istio -- Fault Tolerance" in the "Creating Microservices -- Polyglot Capabilities" chapter of this book. This covers things like retries, timeouts, circuit breakers, bulkheads and rate limits.

MicroProfile also offers an approach, which is outlined in in the "Additional Java Features of Note" chapter under the heading "MicroProfile Fault Tolerance". That section shows how the fallback capability can be used in conjunction with Istio, as well as some more details on those interested in an approach that leverages mpFaultTolerance instead of Istio.

Istio is not capable of offering fallback capabilities, because fallback requires business knowledge. A more advanced approach is to use Istio fault tolerance together with MicroProfile fallback capabilities to achieve the maximum of resilience. For instance, you can specify a fallback backup when calling a backend service. If Istio cannot manage to get a successful return, the fallback method will be invoked.

@GET

@Fallback(fallbackMethod="myFallback")

public String callService() {
    //call servicer b
    return  bclient.hello();

}

public String myFallback() {
    return "Greetings\... This is a fallback!";

}

{: codeblock}

If you use Istio's fault tolerance capability, you can turn them off MicroProfile Fault Toelrance by setting the config property MP_Fault_Tolerance_NonFallback_Enabled to false.

apiVersion: v1
kind: ConfigMap
metadata:
  name: service-config
data:
  serviceB_host: serviceb-service
  serviceB_http_port: "8080"
  lifetime: "0"
  failFrequency: "0"
  MP_Fault_Tolerance_NonFallback_Enabled: "false"

{: codeblock}

For more information on the comparison of Istio Fault Tolerance and MicroProfile Fault Tolerance, please refer to this blog written by Emily Jiang.

You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.