O'Reilly logo

Hands-On Enterprise Java Microservices with Eclipse MicroProfile by Scott Stark, Antoine Sabot-Durand, Pavol Loffay, Jeff Mesnil, Heiko W. Rupp, Cesar Saavedra

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Fault injection in the service mesh

Istio lets you inject faults into the results pretty easily. This sounds counterproductive at the start, but can be a very nice way of testing that you get the fault tolerance handling right. The following VirtualService for Istio defines such fault injection:

apiVersion: networking.istio.io/v1alpha3kind: VirtualServicemetadata:  name: fault-injection-servicespec:  hosts:  - myTarget  http:  - route:    - destination:      host: myTarget    fault:      abort:        httpStatus: 404        percent: 20     delay:       percent: 50       fixedDelay: 200ms

Istio will hear for calls to the destination host, myTarget, and send a 404 response for 20% of the calls instead of the real response code. On top of this, it will delay every other response by 200 milliseconds. ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required